D6263: Typos

2019-04-17 Thread joerg.sonnenberger (Joerg Sonnenberger)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG644eaffab9db: setdiscovery: fix a few typos (authored by 
joerg.sonnenberger, committed by ).

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D6263?vs=14800=14836#toc

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6263?vs=14800=14836

REVISION DETAIL
  https://phab.mercurial-scm.org/D6263

AFFECTED FILES
  mercurial/setdiscovery.py

CHANGE DETAILS

diff --git a/mercurial/setdiscovery.py b/mercurial/setdiscovery.py
--- a/mercurial/setdiscovery.py
+++ b/mercurial/setdiscovery.py
@@ -119,13 +119,13 @@
 self._childrenmap = None
 
 def addcommons(self, commons):
-"""registrer nodes known as common"""
+"""register nodes known as common"""
 self._common.addbases(commons)
 if self._undecided is not None:
 self._common.removeancestorsfrom(self._undecided)
 
 def addmissings(self, missings):
-"""registrer some nodes as missing"""
+"""register some nodes as missing"""
 newmissing = self._repo.revs('%ld::%ld', missings, self.undecided)
 if newmissing:
 self.missing.update(newmissing)



To: joerg.sonnenberger, #hg-reviewers
Cc: martinvonz, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6267: incoming: detect if server send partial replies

2019-04-17 Thread joerg.sonnenberger (Joerg Sonnenberger)
joerg.sonnenberger updated this revision to Diff 14835.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6267?vs=14808=14835

REVISION DETAIL
  https://phab.mercurial-scm.org/D6267

AFFECTED FILES
  mercurial/bundlerepo.py
  tests/test-pull-bundle.t

CHANGE DETAILS

diff --git a/tests/test-pull-bundle.t b/tests/test-pull-bundle.t
--- a/tests/test-pull-bundle.t
+++ b/tests/test-pull-bundle.t
@@ -136,20 +136,21 @@
   updating to branch default
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd repo.pullbundle2a
-  $ hg incoming -r ed1b79f46b9a
+  $ hg incoming
   comparing with http://localhost:$HGPORT2/
   searching for changes
-  changeset:   1:ed1b79f46b9a
+  warning: the server did not send all changes; the follow list is incomplete
+  changeset:   1:effea6de0384
   tag: tip
   user:test
   date:Thu Jan 01 00:00:00 1970 +
-  summary: change foo
+  summary: add bar
   
   $ cd ..
   $ killdaemons.py
   $ grep 'sending pullbundle ' repo/.hg/blackbox.log
   * sending pullbundle "0.hg" (glob)
-  * sending pullbundle "1.hg" (glob)
+  * sending pullbundle "2.hg" (glob)
   $ rm repo/.hg/blackbox.log
 
 Test recovery from misconfigured server sending no new data
diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py
--- a/mercurial/bundlerepo.py
+++ b/mercurial/bundlerepo.py
@@ -636,6 +636,11 @@
 # The discovery process probably need cleanup to avoid that
 localrepo = localrepo.unfiltered()
 
+hasnode = localrepo.changelog.hasnode
+if rheads and any(not hasnode(x) for x in rheads):
+ui.warn(_("warning: the server did not send all changes; "
+  "the follow list is incomplete\n"))
+rheads = [x for x in rheads if hasnode(x)]
 csets = localrepo.changelog.findmissing(common, rheads)
 
 if bundlerepo:



To: joerg.sonnenberger, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6233: rust-discovery: implementing and exposing stats()

2019-04-17 Thread yuja (Yuya Nishihara)
yuja added a comment.


  Can't apply by `:D6233`. Can you rebase?
  
% hg pimp :D6233
applying patch from stdin
patching file mercurial/setdiscovery.py
Hunk #1 succeeded at 167 with fuzz 2 (offset 5 lines).
Hunk #2 FAILED at 343
1 out of 2 hunks FAILED -- saving rejects to file 
mercurial/setdiscovery.py.rej
abort: patch failed to apply

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6233

To: gracinet, #hg-reviewers, kevincox
Cc: yuja, durin42, kevincox, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6249: copies: delete debug message about search limit

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG380f59da7aea: copies: delete debug message about search 
limit (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6249?vs=14823=14833

REVISION DETAIL
  https://phab.mercurial-scm.org/D6249

AFFECTED FILES
  mercurial/copies.py
  tests/test-copy-move-merge.t
  tests/test-double-merge.t
  tests/test-graft.t
  tests/test-issue1802.t
  tests/test-issue522.t
  tests/test-issue672.t
  tests/test-merge-commit.t
  tests/test-merge-criss-cross.t
  tests/test-merge-types.t
  tests/test-merge7.t
  tests/test-rebase-conflicts.t
  tests/test-rename-dir-merge.t
  tests/test-rename-merge1.t
  tests/test-rename-merge2.t
  tests/test-subrepo.t
  tests/test-up-local-change.t

CHANGE DETAILS

diff --git a/tests/test-up-local-change.t b/tests/test-up-local-change.t
--- a/tests/test-up-local-change.t
+++ b/tests/test-up-local-change.t
@@ -40,7 +40,6 @@
   summary: 1
   
   $ hg --debug up
-searching for copies back to rev 1
 unmatched files in other:
  b
   resolving manifests
@@ -68,7 +67,6 @@
   
   $ hg --debug up 0
   starting 4 threads for background file closing (?)
-searching for copies back to rev 0
 unmatched files in local (from topological common ancestor):
  b
   resolving manifests
@@ -95,7 +93,6 @@
   summary: 1
   
   $ hg --debug up
-searching for copies back to rev 1
 unmatched files in other:
  b
   resolving manifests
diff --git a/tests/test-subrepo.t b/tests/test-subrepo.t
--- a/tests/test-subrepo.t
+++ b/tests/test-subrepo.t
@@ -274,7 +274,6 @@
   $ hg ci -m9
   created new head
   $ hg merge 6 --debug # test change
-searching for copies back to rev 2
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 1f14a2e2d3ec, local: f0d2028bf86d+, remote: 1831e14459c4
@@ -301,7 +300,6 @@
   $ hg ci -m10
   committing subrepository t
   $ HGMERGE=internal:merge hg merge --debug 7 # test conflict
-searching for copies back to rev 2
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 1831e14459c4, local: e45c8b14af55+, remote: f94576341bcf
@@ -313,7 +311,6 @@
   starting 4 threads for background file closing (?)
   (M)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev]? m
   merging subrepository "t"
-searching for copies back to rev 2
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 6747d179aa9a, local: 20a0db6fbf6c+, remote: 7af322bc1198
diff --git a/tests/test-rename-merge2.t b/tests/test-rename-merge2.t
--- a/tests/test-rename-merge2.t
+++ b/tests/test-rename-merge2.t
@@ -76,7 +76,6 @@
   --
   test L:up a   R:nc a b W:   - 1  get local a to b
   --
-searching for copies back to rev 1
 unmatched files in other:
  b
 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
@@ -115,7 +114,6 @@
   --
   test L:nc a b R:up a   W:   - 2  get rem change to a and b
   --
-searching for copies back to rev 1
 unmatched files in local:
  b
 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
@@ -155,7 +153,6 @@
   --
   test L:up a   R:nm a b W:   - 3  get local a change to b, remove a
   --
-searching for copies back to rev 1
 unmatched files in other:
  b
 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
@@ -194,7 +191,6 @@
   --
   test L:nm a b R:up a   W:   - 4  get remote change to b
   --
-searching for copies back to rev 1
 unmatched files in local:
  b
 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
@@ -232,7 +228,6 @@
   --
   test L:   R:nc a b W:   - 5  get b
   --
-searching for copies back to rev 1
 unmatched files in other:
  b
 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
@@ -265,7 +260,6 @@
   --
   test L:nc a b R:   W:   - 6  nothing
   --
-searching for copies back to rev 1
 unmatched files in local:
  b
 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
@@ -297,7 +291,6 @@
   --
   test L:   R:nm a b W:   - 7  get b
   --
-searching for copies back to rev 1
 unmatched files in other:
  b
 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
@@ -331,7 +324,6 @@
   --
   test L:nm a b R:   W:   - 8  nothing
   --
-searching for copies back to rev 1
 unmatched files in local:
  b
 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
@@ -362,7 +354,6 @@
   --
   test L:um a b R:um a b W:   - 9  do merge with 

Re: D6233: rust-discovery: implementing and exposing stats()

2019-04-17 Thread Yuya Nishihara
Can't apply by `:D6233`. Can you rebase?

```
% hg pimp :D6233
applying patch from stdin
patching file mercurial/setdiscovery.py
Hunk #1 succeeded at 167 with fuzz 2 (offset 5 lines).
Hunk #2 FAILED at 343
1 out of 2 hunks FAILED -- saving rejects to file mercurial/setdiscovery.py.rej
abort: patch failed to apply
```
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH] chistedit: use context manager to set verbose ui

2019-04-17 Thread Yuya Nishihara
On Tue, 16 Apr 2019 13:13:45 -0400, Jordi Gutiérrez Hermoso wrote:
> # HG changeset patch
> # User Jordi Gutiérrez Hermoso 
> # Date 1555434741 14400
> #  Tue Apr 16 13:12:21 2019 -0400
> # Node ID f64bbdc70aaa1ca8c504c2d909f6012927a27cb8
> # Parent  a362b0b95e42c8f7d46d7e3a0eb4cc531fa5f2d6
> chistedit: use context manager to set verbose ui

Queued, thanks.

> I'm still not exactly sure why this is necessary -- perhaps setting it
> unconditionally would leak this setting in chg invocations.

No in chg, but that could theoretically happen in a single-process
commandserver.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6250: copies: delete debug message about changes since common ancestor

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG43c2a13b56eb: copies: delete debug message about changes 
since common ancestor (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6250?vs=14824=14832

REVISION DETAIL
  https://phab.mercurial-scm.org/D6250

AFFECTED FILES
  mercurial/copies.py
  tests/test-graft.t
  tests/test-rebase-conflicts.t
  tests/test-up-local-change.t

CHANGE DETAILS

diff --git a/tests/test-up-local-change.t b/tests/test-up-local-change.t
--- a/tests/test-up-local-change.t
+++ b/tests/test-up-local-change.t
@@ -67,8 +67,6 @@
   
   $ hg --debug up 0
   starting 4 threads for background file closing (?)
-unmatched files in local (from topological common ancestor):
- b
   resolving manifests
branchmerge: False, force: False, partial: False
ancestor: 1e71731e6fbb, local: 1e71731e6fbb+, remote: c19d34741b0a
diff --git a/tests/test-rebase-conflicts.t b/tests/test-rebase-conflicts.t
--- a/tests/test-rebase-conflicts.t
+++ b/tests/test-rebase-conflicts.t
@@ -248,8 +248,6 @@
   getting f1.txt
merge against 9:e31216eec445
  detach base 8:8e4e2c1a07ae
-unmatched files in other (from topological common ancestor):
- f2.txt
   resolving manifests
branchmerge: True, force: True, partial: False
ancestor: 8e4e2c1a07ae, local: 4bc80088dc6b+, remote: e31216eec445
@@ -267,8 +265,6 @@
already in destination
merge against 10:2f2496ddf49d
  detach base 9:e31216eec445
-unmatched files in other (from topological common ancestor):
- f2.txt
   resolving manifests
branchmerge: True, force: True, partial: False
ancestor: e31216eec445, local: 19c888675e13+, remote: 2f2496ddf49d
diff --git a/tests/test-graft.t b/tests/test-graft.t
--- a/tests/test-graft.t
+++ b/tests/test-graft.t
@@ -220,8 +220,6 @@
   committing changelog
   updating the branch cache
   grafting 5:97f8bfe72746 "5"
-unmatched files in other (from topological common ancestor):
- c
   resolving manifests
branchmerge: True, force: True, partial: False
ancestor: 4c60f11aa304, local: 6b9e5368ca4e+, remote: 97f8bfe72746
@@ -235,8 +233,6 @@
   $ HGEDITOR=cat hg graft 4 3 --log --debug
   scanning for duplicate grafts
   grafting 4:9c233e8e184d "4"
-unmatched files in other (from topological common ancestor):
- c
   resolving manifests
branchmerge: True, force: True, partial: False
ancestor: 4c60f11aa304, local: 1905859650ec+, remote: 9c233e8e184d
@@ -741,8 +737,6 @@
   $ hg graft -q 13 --debug
   scanning for duplicate grafts
   grafting 13:7a4785234d87 "2"
-unmatched files in other (from topological common ancestor):
- g
 unmatched files new in both:
  b
 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -353,27 +353,23 @@
 return _chain(x, y, _backwardrenames(x, a, match=match),
   _forwardcopies(a, y, match=match))
 
-def _computenonoverlap(repo, c1, c2, addedinm1, addedinm2, baselabel=''):
+def _computenonoverlap(repo, c1, c2, addedinm1, addedinm2, debug=True):
 """Computes, based on addedinm1 and addedinm2, the files exclusive to c1
 and c2. This is its own function so extensions can easily wrap this call
 to see what files mergecopies is about to process.
 
 Even though c1 and c2 are not used in this function, they are useful in
 other extensions for being able to read the file nodes of the changed 
files.
-
-"baselabel" can be passed to help distinguish the multiple computations
-done in the graft case.
 """
 u1 = sorted(addedinm1 - addedinm2)
 u2 = sorted(addedinm2 - addedinm1)
 
-header = "  unmatched files in %s"
-if baselabel:
-header += ' (from %s)' % baselabel
-if u1:
-repo.ui.debug("%s:\n   %s\n" % (header % 'local', "\n   ".join(u1)))
-if u2:
-repo.ui.debug("%s:\n   %s\n" % (header % 'other', "\n   ".join(u2)))
+if debug:
+header = "  unmatched files in %s"
+if u1:
+repo.ui.debug("%s:\n   %s\n" % (header % 'local', "\n   
".join(u1)))
+if u2:
+repo.ui.debug("%s:\n   %s\n" % (header % 'other', "\n   
".join(u2)))
 
 return u1, u2
 
@@ -588,15 +584,14 @@
 u1u, u2u = u1r, u2r
 else:
 # unmatched file from base (DAG rotation in the graft case)
-u1r, u2r = _computenonoverlap(repo, c1, c2, addedinm1, addedinm2,
-  baselabel='base')
+u1r, u2r = _computenonoverlap(repo, c1, c2, addedinm1, addedinm2)
 # unmatched file from topological common ancestors (no DAG rotation)
 # need to recompute this for directory move handling when grafting
 mta = tca.manifest()
 u1u, u2u = _computenonoverlap(repo, c1, c2,
   

D6251: copies: delete debug message about "unmatched files new in both"

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG1e266bd9f25b: copies: delete debug message about 
unmatched files new in both (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6251?vs=14825=14834

REVISION DETAIL
  https://phab.mercurial-scm.org/D6251

AFFECTED FILES
  mercurial/copies.py
  tests/test-graft.t
  tests/test-rename-merge2.t

CHANGE DETAILS

diff --git a/tests/test-rename-merge2.t b/tests/test-rename-merge2.t
--- a/tests/test-rename-merge2.t
+++ b/tests/test-rename-merge2.t
@@ -354,8 +354,6 @@
   --
   test L:um a b R:um a b W:   - 9  do merge with ancestor in a
   --
-unmatched files new in both:
- b
 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
  src: 'a' -> dst: 'b' *
 checking for directory renames
@@ -435,8 +433,6 @@
   --
   test L:nc a b R:up b   W:   - 12 merge b no ancestor
   --
-unmatched files new in both:
- b
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: 86a2aa42fc76+, remote: af30c7647fc7
@@ -473,8 +469,6 @@
   --
   test L:up b   R:nm a b W:   - 13 merge b no ancestor
   --
-unmatched files new in both:
- b
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: 59318016310c+, remote: bdb19105162a
@@ -512,8 +506,6 @@
   --
   test L:nc a b R:up a b W:   - 14 merge b no ancestor
   --
-unmatched files new in both:
- b
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: 86a2aa42fc76+, remote: 8dbce441892a
@@ -551,8 +543,6 @@
   --
   test L:up b   R:nm a b W:   - 15 merge b no ancestor, remove a
   --
-unmatched files new in both:
- b
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: 59318016310c+, remote: bdb19105162a
@@ -590,8 +580,6 @@
   --
   test L:nc a b R:up a b W:   - 16 get a, merge b no ancestor
   --
-unmatched files new in both:
- b
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: 86a2aa42fc76+, remote: 8dbce441892a
@@ -629,8 +617,6 @@
   --
   test L:up a b R:nc a b W:   - 17 keep a, merge b no ancestor
   --
-unmatched files new in both:
- b
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: 0b76e65c8289+, remote: 4ce40f5aca24
@@ -667,8 +653,6 @@
   --
   test L:nm a b R:up a b W:   - 18 merge b no ancestor
   --
-unmatched files new in both:
- b
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: 02963e448370+, remote: 8dbce441892a
@@ -711,8 +695,6 @@
   --
   test L:up a b R:nm a b W:   - 19 merge b no ancestor, prompt remove a
   --
-unmatched files new in both:
- b
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: 0b76e65c8289+, remote: bdb19105162a
@@ -929,9 +911,6 @@
  3/g
  4/g
  7/f
-unmatched files new in both:
- 0/f
- 1/g
 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
  src: '1/f' -> dst: '1/g' *
  src: '3/f' -> dst: '3/g' *
diff --git a/tests/test-graft.t b/tests/test-graft.t
--- a/tests/test-graft.t
+++ b/tests/test-graft.t
@@ -737,8 +737,6 @@
   $ hg graft -q 13 --debug
   scanning for duplicate grafts
   grafting 13:7a4785234d87 "2"
-unmatched files new in both:
- b
 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
  src: 'a' -> dst: 'b' *
 checking for directory renames
diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -625,9 +625,6 @@
 else:
 divergeset.update(fl) # reverse map for below
 
-if bothnew:
-repo.ui.debug("  unmatched files new in both:\n   %s\n"
-  % "\n   ".join(bothnew))
 bothdiverge = {}
 bothincompletediverge = {}
 remainder = {}



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6246: copies: fix up "fullcopy" with missing entries from "copy"

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG96bd75e67a94: copies: fix up fullcopy with 
missing entries from copy (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6246?vs=14820=14829

REVISION DETAIL
  https://phab.mercurial-scm.org/D6246

AFFECTED FILES
  mercurial/copies.py
  tests/test-graft.t
  tests/test-rename-merge2.t

CHANGE DETAILS

diff --git a/tests/test-rename-merge2.t b/tests/test-rename-merge2.t
--- a/tests/test-rename-merge2.t
+++ b/tests/test-rename-merge2.t
@@ -365,6 +365,9 @@
 searching for copies back to rev 1
 unmatched files new in both:
  b
+all copies found (* = to merge, ! = divergent, % = renamed and deleted):
+ src: 'a' -> dst: 'b' *
+checking for directory renames
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: 62e7bf090eba+, remote: 49b6d8032493
@@ -952,6 +955,7 @@
  0/f
  1/g
 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
+ src: '1/f' -> dst: '1/g' *
  src: '3/f' -> dst: '3/g' *
  src: '4/f' -> dst: '4/g' *
  src: '5/f' -> dst: '5/g' *
diff --git a/tests/test-graft.t b/tests/test-graft.t
--- a/tests/test-graft.t
+++ b/tests/test-graft.t
@@ -749,6 +749,9 @@
  g
 unmatched files new in both:
  b
+all copies found (* = to merge, ! = divergent, % = renamed and deleted):
+ src: 'a' -> dst: 'b' *
+checking for directory renames
   resolving manifests
branchmerge: True, force: True, partial: False
ancestor: b592ea63bb0c, local: 7e61b508e709+, remote: 7a4785234d87
diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -687,6 +687,10 @@
 for dst, src in fullcopy.copy().items():
 if src not in mb:
 del fullcopy[dst]
+# Sometimes we forget to add entries from "copy" to "fullcopy", so fix
+# that up here
+for dst, src in copy.items():
+fullcopy[dst] = src
 if fullcopy and repo.ui.debugflag:
 repo.ui.debug("  all copies found (* = to merge, ! = divergent, "
   "% = renamed and deleted):\n")



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6248: copies: move early return for "no copies" case a little earlier

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG85f5934016f9: copies: move early return for no 
copies case a little earlier (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6248?vs=14822=14831

REVISION DETAIL
  https://phab.mercurial-scm.org/D6248

AFFECTED FILES
  mercurial/copies.py

CHANGE DETAILS

diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -696,7 +696,11 @@
 for src, dsts in diverge.items():
 for dst in dsts:
 fullcopy[dst] = src
-if fullcopy and repo.ui.debugflag:
+
+if not fullcopy:
+return copy, {}, diverge, renamedelete, {}
+
+if repo.ui.debugflag:
 repo.ui.debug("  all copies found (* = to merge, ! = divergent, "
   "% = renamed and deleted):\n")
 for f in sorted(fullcopy):
@@ -711,9 +715,6 @@
   note))
 del divergeset
 
-if not fullcopy:
-return copy, {}, diverge, renamedelete, {}
-
 repo.ui.debug("  checking for directory renames\n")
 
 # generate a directory move map



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6245: merge: remove workaround for issue5020

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGbeec7fc6adec: merge: remove workaround for issue5020 
(authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6245?vs=14773=14828

REVISION DETAIL
  https://phab.mercurial-scm.org/D6245

AFFECTED FILES
  mercurial/merge.py

CHANGE DETAILS

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -1380,17 +1380,14 @@
 # Pick the best bid for each file
 repo.ui.note(_('\nauction for merging merge bids\n'))
 actions = {}
-dms = [] # filenames that have dm actions
 for f, bids in sorted(fbids.items()):
 # bids is a mapping from action method to list af actions
 # Consensus?
 if len(bids) == 1: # all bids are the same kind of method
 m, l = list(bids.items())[0]
 if all(a == l[0] for a in l[1:]): # len(bids) is > 1
 repo.ui.note(_(" %s: consensus for %s\n") % (f, m))
 actions[f] = l[0]
-if m == ACTION_DIR_RENAME_MOVE_LOCAL:
-dms.append(f)
 continue
 # If keep is an option, just do it.
 if ACTION_KEEP in bids:
@@ -1415,18 +1412,7 @@
 repo.ui.warn(_(' %s: ambiguous merge - picked %s action\n') %
  (f, m))
 actions[f] = l[0]
-if m == ACTION_DIR_RENAME_MOVE_LOCAL:
-dms.append(f)
 continue
-# Work around 'dm' that can cause multiple actions for the same file
-for f in dms:
-dm, (f0, flags), msg = actions[f]
-assert dm == ACTION_DIR_RENAME_MOVE_LOCAL, dm
-if f0 in actions and actions[f0][0] == ACTION_REMOVE:
-# We have one bid for removing a file and another for moving 
it.
-# These two could be merged as first move and then delete ...
-# but instead drop moving and just delete.
-del actions[f]
 repo.ui.note(_('end of auction\n\n'))
 
 if wctx.rev() is None:



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6247: copies: fix up "fullcopy" with missing entries from "diverge"

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG22c9ffdf8ef6: copies: fix up fullcopy with 
missing entries from diverge (authored by martinvonz, committed by 
).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6247?vs=14821=14830

REVISION DETAIL
  https://phab.mercurial-scm.org/D6247

AFFECTED FILES
  mercurial/copies.py

CHANGE DETAILS

diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -691,6 +691,11 @@
 # that up here
 for dst, src in copy.items():
 fullcopy[dst] = src
+# Sometimes we forget to add entries from "diverge" to "fullcopy", so fix
+# that up here
+for src, dsts in diverge.items():
+for dst in dsts:
+fullcopy[dst] = src
 if fullcopy and repo.ui.debugflag:
 repo.ui.debug("  all copies found (* = to merge, ! = divergent, "
   "% = renamed and deleted):\n")



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6244: copies: don't include copies that are not in source in directory move

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG31abb9d713af: copies: dont include copies that are 
not in source in directory move (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6244?vs=14819=14827

REVISION DETAIL
  https://phab.mercurial-scm.org/D6244

AFFECTED FILES
  mercurial/copies.py
  tests/test-merge-criss-cross.t

CHANGE DETAILS

diff --git a/tests/test-merge-criss-cross.t b/tests/test-merge-criss-cross.t
--- a/tests/test-merge-criss-cross.t
+++ b/tests/test-merge-criss-cross.t
@@ -423,17 +423,10 @@
  d1/b
 unmatched files in other:
  d2/b
-all copies found (* = to merge, ! = divergent, % = renamed and deleted):
- src: 'd1/b' -> dst: 'd2/b' 
-checking for directory renames
- discovered dir src: 'd1/' -> dst: 'd2/'
- pending file src: 'd1/a' -> dst: 'd2/a'
- pending file src: 'd1/b' -> dst: 'd2/b'
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 11b5b303e36c, local: c0ef19750a22+, remote: 6ca01f7342b9
-   d2/a: remote directory rename - move from d1/a -> dm
-   d2/b: remote directory rename, both created -> m
+   d2/b: remote created -> g
   
   calculating bids for ancestor 154e6000f54e
 searching for copies back to rev 3
@@ -453,8 +446,7 @@
   auction for merging merge bids
d1/a: consensus for r
d1/b: consensus for r
-   d2/a: consensus for dm
-   d2/b: picking 'get' action
+   d2/b: consensus for g
   end of auction
   
d1/a: other deleted -> r
diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -682,6 +682,11 @@
 if len(fl) == 2 and fl[0] == fl[1]:
 copy[fl[0]] = of # not actually divergent, just matching renames
 
+# Sometimes we get invalid copies here (the "and not remotebase" in
+# _checkcopies() seems suspicious). Filter them out.
+for dst, src in fullcopy.copy().items():
+if src not in mb:
+del fullcopy[dst]
 if fullcopy and repo.ui.debugflag:
 repo.ui.debug("  all copies found (* = to merge, ! = divergent, "
   "% = renamed and deleted):\n")



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6242: tests: add test for issue5343 (grafting with copies)

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG7815cf0ea88b: tests: add test for issue5343 (grafting with 
copies) (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6242?vs=14770=14826

REVISION DETAIL
  https://phab.mercurial-scm.org/D6242

AFFECTED FILES
  tests/test-graft.t

CHANGE DETAILS

diff --git a/tests/test-graft.t b/tests/test-graft.t
--- a/tests/test-graft.t
+++ b/tests/test-graft.t
@@ -969,7 +969,6 @@
 A.4 has a degenerate case a<-b<-a->a, where checkcopies isn't needed at all.
 A.5 has a special case a<-b<-b->a, which is treated like a<-b->a in a merge.
 A.5 has issue5343 as a special case.
-TODO: add test coverage for A.5
 A.6 has a special case a<-a<-b->a. Here, checkcopies will find a spurious
 incomplete divergence, which is in fact complete. This is handled later in
 mergecopies.
@@ -1072,13 +1071,32 @@
   $ hg mv f4a f4e
   $ hg mv f5a f5b
   $ hg ci -qAm "E0"
+  $ hg up -q "min(desc("A0"))"
+  $ hg cp f1a f1f
+  $ hg ci -qAm "F0"
+  $ hg up -q "min(desc("A0"))"
+  $ hg cp f1a f1g
+  $ echo c1g > f1g
+  $ hg ci -qAm "G0"
   $ hg log -G
-  @  changeset:   6:6bd1736cab86
+  @  changeset:   8:ba67f08fb15a
   |  tag: tip
   |  parent:  0:11f7a1b56675
   |  user:test
   |  date:Thu Jan 01 00:00:00 1970 +
-  |  summary: E0
+  |  summary: G0
+  |
+  | o  changeset:   7:d376ab0d7fda
+  |/   parent:  0:11f7a1b56675
+  |user:test
+  |date:Thu Jan 01 00:00:00 1970 +
+  |summary: F0
+  |
+  | o  changeset:   6:6bd1736cab86
+  |/   parent:  0:11f7a1b56675
+  |user:test
+  |date:Thu Jan 01 00:00:00 1970 +
+  |summary: E0
   |
   | o  changeset:   5:560daee679da
   | |  user:test
@@ -1115,6 +1133,7 @@
 Test the cases A.4 (f1x), the "ping-pong" special case of A.7 (f5x),
 and A.3 with a local content change to be preserved (f2x).
 
+  $ hg up -q "desc("E0")"
   $ HGEDITOR="echo C2 >" hg graft -r 'desc("C0")' --edit
   grafting 2:f58c7e2b28fa "C0"
   merging f1e and f1b to f1e
@@ -1131,154 +1150,301 @@
   merging f4e and f4a to f4e
   warning: can't find ancestor for 'f3d' copied from 'f3b'!
 
+  $ hg cat f2c
+  c2e
+
+Test the case A.5 (move case, f1x).
+
+  $ hg up -q "desc("C0")"
+BROKEN: Shouldn't get the warning about missing ancestor
+  $ HGEDITOR="echo E1 >" hg graft -r 'desc("E0")' --edit
+  grafting 6:6bd1736cab86 "E0"
+  note: possible conflict - f1a was renamed multiple times to:
+   f1b
+   f1e
+  note: possible conflict - f3a was renamed multiple times to:
+   f3b
+   f3e
+  merging f2c and f2a to f2c
+  merging f5a and f5b to f5b
+  warning: can't find ancestor for 'f1e' copied from 'f1a'!
+  warning: can't find ancestor for 'f3e' copied from 'f3a'!
+  $ cat f1e
+  c1a
+
+Test the case A.5 (copy case, f1x).
+
+  $ hg up -q "desc("C0")"
+BROKEN: Shouldn't get the warning about missing ancestor
+  $ HGEDITOR="echo F1 >" hg graft -r 'desc("F0")' --edit
+  grafting 7:d376ab0d7fda "F0"
+  warning: can't find ancestor for 'f1f' copied from 'f1a'!
+BROKEN: f1f should be marked a copy from f1b
+  $ hg st --copies --change .
+  A f1f
+BROKEN: f1f should have the new content from f1b (i.e. "c1c")
+  $ cat f1f
+  c1a
+
+Test the case A.5 (copy+modify case, f1x).
+
+  $ hg up -q "desc("C0")"
+BROKEN: We should get a merge conflict from the 3-way merge between f1b in C0
+(content "c1c") and f1g in G0 (content "c1g") with f1a in A0 as base (content
+"c1a")
+  $ HGEDITOR="echo G1 >" hg graft -r 'desc("G0")' --edit
+  grafting 8:ba67f08fb15a "G0"
+  warning: can't find ancestor for 'f1g' copied from 'f1a'!
+
 Check the results of the grafts tested
 
   $ hg log -CGv --patch --git
-  @  changeset:   8:93ee502e8b0a
+  @  changeset:   13:ef3adf6c20a4
   |  tag: tip
+  |  parent:  2:f58c7e2b28fa
   |  user:test
   |  date:Thu Jan 01 00:00:00 1970 +
-  |  files:   f3d f4e
+  |  files:   f1g
   |  description:
-  |  D2
+  |  G1
   |
   |
-  |  diff --git a/f3d b/f3d
+  |  diff --git a/f1g b/f1g
   |  new file mode 100644
   |  --- /dev/null
-  |  +++ b/f3d
+  |  +++ b/f1g
   |  @@ -0,0 +1,1 @@
-  |  +c3a
-  |  diff --git a/f4e b/f4e
-  |  --- a/f4e
-  |  +++ b/f4e
-  |  @@ -1,1 +1,1 @@
-  |  -c4a
-  |  +c4d
+  |  +c1g
   |
-  o  changeset:   7:539cf145f496
-  |  user:test
-  |  date:Thu Jan 01 00:00:00 1970 +
-  |  files:   f1e f2a f2c f5a f5b
-  |  copies:  f2c (f2a) f5a (f5b)
-  |  description:
-  |  C2
+  | o  changeset:   12:b5542d755b54
+  |/   parent:  2:f58c7e2b28fa
+  |user:test
+  |date:Thu Jan 01 00:00:00 1970 +
+  |files:   f1f
+  |description:
+  |F1
   |
   |
-  |  diff --git a/f1e b/f1e
-  |  --- a/f1e
-  |  +++ b/f1e
-  |  @@ -1,1 +1,1 @@
-  |  -c1a
-  |  +c1c
-  |  diff --git a/f2a b/f2c
-  |  rename from f2a
-  |  rename to f2c
- 

Re: [PATCH 4 of 4 V3] verify: also check full manifest validity during verify runs

2019-04-17 Thread Martin von Zweigbergk via Mercurial-devel
On Wed, Apr 17, 2019 at 8:25 AM Pierre-Yves David <
pierre-yves.da...@ens-lyon.org> wrote:

> # HG changeset patch
> # User Pierre-Yves David 
> # Date 1551881213 -3600
> #  Wed Mar 06 15:06:53 2019 +0100
> # Node ID 15d38aadce0e1a4cc526e9bbbc42a158c263df53
> # Parent  9bec7491e9b4cabdfa4d264e5213b1f416ec2607
> # EXP-Topic verify
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r
> 15d38aadce0e
> verify: also check full manifest validity during verify runs
>

Queued, thanks.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 1 of 2 V2] peer: introduce a limitedarguments attributes

2019-04-17 Thread Martin von Zweigbergk via Mercurial-devel
On Wed, Apr 17, 2019 at 2:38 PM Martin von Zweigbergk 
wrote:

>
>
> On Wed, Apr 17, 2019 at 2:33 PM Joerg Sonnenberger  wrote:
>
>> On Wed, Apr 17, 2019 at 11:33:45AM -0700, Martin von Zweigbergk via
>> Mercurial-devel wrote:
>> > Question 3: Does httppostargs switch GET requests to POST requests?
>> >
>> > I believe the answer is "no".
>>
>> See makev1commandrest in httppeer.py line 137ff. The answer is "yes, if
>> they exist".
>>
>
> Thanks. That's a clear answer to my original question.
>

Given that, it seems safe to me. I've queued this series, thanks.


>
>
>>
>> Joerg
>> ___
>> Mercurial-devel mailing list
>> Mercurial-devel@mercurial-scm.org
>> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>>
>
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6263: Typos

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment.


  I haven't run tests on this, but I'm guessing one of the `test-check*` tests 
will tell you that your subject line ("Typos") does not follow our style guide 
(you could change it to something like "setdiscovery: fix a few typos").

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6263

To: joerg.sonnenberger, #hg-reviewers
Cc: martinvonz, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6249: copies: delete debug message about search limit

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
martinvonz updated this revision to Diff 14823.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6249?vs=14777=14823

REVISION DETAIL
  https://phab.mercurial-scm.org/D6249

AFFECTED FILES
  mercurial/copies.py
  tests/test-copy-move-merge.t
  tests/test-double-merge.t
  tests/test-graft.t
  tests/test-issue1802.t
  tests/test-issue522.t
  tests/test-issue672.t
  tests/test-merge-commit.t
  tests/test-merge-criss-cross.t
  tests/test-merge-types.t
  tests/test-merge7.t
  tests/test-rebase-conflicts.t
  tests/test-rename-dir-merge.t
  tests/test-rename-merge1.t
  tests/test-rename-merge2.t
  tests/test-subrepo.t
  tests/test-up-local-change.t

CHANGE DETAILS

diff --git a/tests/test-up-local-change.t b/tests/test-up-local-change.t
--- a/tests/test-up-local-change.t
+++ b/tests/test-up-local-change.t
@@ -40,7 +40,6 @@
   summary: 1
   
   $ hg --debug up
-searching for copies back to rev 1
 unmatched files in other:
  b
   resolving manifests
@@ -68,7 +67,6 @@
   
   $ hg --debug up 0
   starting 4 threads for background file closing (?)
-searching for copies back to rev 0
 unmatched files in local (from topological common ancestor):
  b
   resolving manifests
@@ -95,7 +93,6 @@
   summary: 1
   
   $ hg --debug up
-searching for copies back to rev 1
 unmatched files in other:
  b
   resolving manifests
diff --git a/tests/test-subrepo.t b/tests/test-subrepo.t
--- a/tests/test-subrepo.t
+++ b/tests/test-subrepo.t
@@ -274,7 +274,6 @@
   $ hg ci -m9
   created new head
   $ hg merge 6 --debug # test change
-searching for copies back to rev 2
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 1f14a2e2d3ec, local: f0d2028bf86d+, remote: 1831e14459c4
@@ -301,7 +300,6 @@
   $ hg ci -m10
   committing subrepository t
   $ HGMERGE=internal:merge hg merge --debug 7 # test conflict
-searching for copies back to rev 2
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 1831e14459c4, local: e45c8b14af55+, remote: f94576341bcf
@@ -313,7 +311,6 @@
   starting 4 threads for background file closing (?)
   (M)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev]? m
   merging subrepository "t"
-searching for copies back to rev 2
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 6747d179aa9a, local: 20a0db6fbf6c+, remote: 7af322bc1198
diff --git a/tests/test-rename-merge2.t b/tests/test-rename-merge2.t
--- a/tests/test-rename-merge2.t
+++ b/tests/test-rename-merge2.t
@@ -76,7 +76,6 @@
   --
   test L:up a   R:nc a b W:   - 1  get local a to b
   --
-searching for copies back to rev 1
 unmatched files in other:
  b
 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
@@ -115,7 +114,6 @@
   --
   test L:nc a b R:up a   W:   - 2  get rem change to a and b
   --
-searching for copies back to rev 1
 unmatched files in local:
  b
 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
@@ -155,7 +153,6 @@
   --
   test L:up a   R:nm a b W:   - 3  get local a change to b, remove a
   --
-searching for copies back to rev 1
 unmatched files in other:
  b
 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
@@ -194,7 +191,6 @@
   --
   test L:nm a b R:up a   W:   - 4  get remote change to b
   --
-searching for copies back to rev 1
 unmatched files in local:
  b
 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
@@ -232,7 +228,6 @@
   --
   test L:   R:nc a b W:   - 5  get b
   --
-searching for copies back to rev 1
 unmatched files in other:
  b
 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
@@ -265,7 +260,6 @@
   --
   test L:nc a b R:   W:   - 6  nothing
   --
-searching for copies back to rev 1
 unmatched files in local:
  b
 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
@@ -297,7 +291,6 @@
   --
   test L:   R:nm a b W:   - 7  get b
   --
-searching for copies back to rev 1
 unmatched files in other:
  b
 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
@@ -331,7 +324,6 @@
   --
   test L:nm a b R:   W:   - 8  nothing
   --
-searching for copies back to rev 1
 unmatched files in local:
  b
 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
@@ -362,7 +354,6 @@
   --
   test L:um a b R:um a b W:   - 9  do merge with ancestor in a
   --
-searching for copies back to rev 1
 unmatched files new in both:
  b
 all copies found (* = to 

D6250: copies: delete debug message about changes since common ancestor

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
martinvonz updated this revision to Diff 14824.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6250?vs=14778=14824

REVISION DETAIL
  https://phab.mercurial-scm.org/D6250

AFFECTED FILES
  mercurial/copies.py
  tests/test-graft.t
  tests/test-rebase-conflicts.t
  tests/test-up-local-change.t

CHANGE DETAILS

diff --git a/tests/test-up-local-change.t b/tests/test-up-local-change.t
--- a/tests/test-up-local-change.t
+++ b/tests/test-up-local-change.t
@@ -67,8 +67,6 @@
   
   $ hg --debug up 0
   starting 4 threads for background file closing (?)
-unmatched files in local (from topological common ancestor):
- b
   resolving manifests
branchmerge: False, force: False, partial: False
ancestor: 1e71731e6fbb, local: 1e71731e6fbb+, remote: c19d34741b0a
diff --git a/tests/test-rebase-conflicts.t b/tests/test-rebase-conflicts.t
--- a/tests/test-rebase-conflicts.t
+++ b/tests/test-rebase-conflicts.t
@@ -248,8 +248,6 @@
   getting f1.txt
merge against 9:e31216eec445
  detach base 8:8e4e2c1a07ae
-unmatched files in other (from topological common ancestor):
- f2.txt
   resolving manifests
branchmerge: True, force: True, partial: False
ancestor: 8e4e2c1a07ae, local: 4bc80088dc6b+, remote: e31216eec445
@@ -267,8 +265,6 @@
already in destination
merge against 10:2f2496ddf49d
  detach base 9:e31216eec445
-unmatched files in other (from topological common ancestor):
- f2.txt
   resolving manifests
branchmerge: True, force: True, partial: False
ancestor: e31216eec445, local: 19c888675e13+, remote: 2f2496ddf49d
diff --git a/tests/test-graft.t b/tests/test-graft.t
--- a/tests/test-graft.t
+++ b/tests/test-graft.t
@@ -220,8 +220,6 @@
   committing changelog
   updating the branch cache
   grafting 5:97f8bfe72746 "5"
-unmatched files in other (from topological common ancestor):
- c
   resolving manifests
branchmerge: True, force: True, partial: False
ancestor: 4c60f11aa304, local: 6b9e5368ca4e+, remote: 97f8bfe72746
@@ -235,8 +233,6 @@
   $ HGEDITOR=cat hg graft 4 3 --log --debug
   scanning for duplicate grafts
   grafting 4:9c233e8e184d "4"
-unmatched files in other (from topological common ancestor):
- c
   resolving manifests
branchmerge: True, force: True, partial: False
ancestor: 4c60f11aa304, local: 1905859650ec+, remote: 9c233e8e184d
@@ -741,8 +737,6 @@
   $ hg graft -q 13 --debug
   scanning for duplicate grafts
   grafting 13:7a4785234d87 "2"
-unmatched files in other (from topological common ancestor):
- g
 unmatched files new in both:
  b
 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -353,27 +353,23 @@
 return _chain(x, y, _backwardrenames(x, a, match=match),
   _forwardcopies(a, y, match=match))
 
-def _computenonoverlap(repo, c1, c2, addedinm1, addedinm2, baselabel=''):
+def _computenonoverlap(repo, c1, c2, addedinm1, addedinm2, debug=True):
 """Computes, based on addedinm1 and addedinm2, the files exclusive to c1
 and c2. This is its own function so extensions can easily wrap this call
 to see what files mergecopies is about to process.
 
 Even though c1 and c2 are not used in this function, they are useful in
 other extensions for being able to read the file nodes of the changed 
files.
-
-"baselabel" can be passed to help distinguish the multiple computations
-done in the graft case.
 """
 u1 = sorted(addedinm1 - addedinm2)
 u2 = sorted(addedinm2 - addedinm1)
 
-header = "  unmatched files in %s"
-if baselabel:
-header += ' (from %s)' % baselabel
-if u1:
-repo.ui.debug("%s:\n   %s\n" % (header % 'local', "\n   ".join(u1)))
-if u2:
-repo.ui.debug("%s:\n   %s\n" % (header % 'other', "\n   ".join(u2)))
+if debug:
+header = "  unmatched files in %s"
+if u1:
+repo.ui.debug("%s:\n   %s\n" % (header % 'local', "\n   
".join(u1)))
+if u2:
+repo.ui.debug("%s:\n   %s\n" % (header % 'other', "\n   
".join(u2)))
 
 return u1, u2
 
@@ -588,15 +584,14 @@
 u1u, u2u = u1r, u2r
 else:
 # unmatched file from base (DAG rotation in the graft case)
-u1r, u2r = _computenonoverlap(repo, c1, c2, addedinm1, addedinm2,
-  baselabel='base')
+u1r, u2r = _computenonoverlap(repo, c1, c2, addedinm1, addedinm2)
 # unmatched file from topological common ancestors (no DAG rotation)
 # need to recompute this for directory move handling when grafting
 mta = tca.manifest()
 u1u, u2u = _computenonoverlap(repo, c1, c2,
   m1.filesnotin(mta, repo.narrowmatch()),
   m2.filesnotin(mta, repo.narrowmatch()),
-   

D6251: copies: delete debug message about "unmatched files new in both"

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
martinvonz updated this revision to Diff 14825.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6251?vs=14779=14825

REVISION DETAIL
  https://phab.mercurial-scm.org/D6251

AFFECTED FILES
  mercurial/copies.py
  tests/test-graft.t
  tests/test-rename-merge2.t

CHANGE DETAILS

diff --git a/tests/test-rename-merge2.t b/tests/test-rename-merge2.t
--- a/tests/test-rename-merge2.t
+++ b/tests/test-rename-merge2.t
@@ -354,8 +354,6 @@
   --
   test L:um a b R:um a b W:   - 9  do merge with ancestor in a
   --
-unmatched files new in both:
- b
 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
  src: 'a' -> dst: 'b' *
 checking for directory renames
@@ -435,8 +433,6 @@
   --
   test L:nc a b R:up b   W:   - 12 merge b no ancestor
   --
-unmatched files new in both:
- b
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: 86a2aa42fc76+, remote: af30c7647fc7
@@ -473,8 +469,6 @@
   --
   test L:up b   R:nm a b W:   - 13 merge b no ancestor
   --
-unmatched files new in both:
- b
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: 59318016310c+, remote: bdb19105162a
@@ -512,8 +506,6 @@
   --
   test L:nc a b R:up a b W:   - 14 merge b no ancestor
   --
-unmatched files new in both:
- b
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: 86a2aa42fc76+, remote: 8dbce441892a
@@ -551,8 +543,6 @@
   --
   test L:up b   R:nm a b W:   - 15 merge b no ancestor, remove a
   --
-unmatched files new in both:
- b
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: 59318016310c+, remote: bdb19105162a
@@ -590,8 +580,6 @@
   --
   test L:nc a b R:up a b W:   - 16 get a, merge b no ancestor
   --
-unmatched files new in both:
- b
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: 86a2aa42fc76+, remote: 8dbce441892a
@@ -629,8 +617,6 @@
   --
   test L:up a b R:nc a b W:   - 17 keep a, merge b no ancestor
   --
-unmatched files new in both:
- b
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: 0b76e65c8289+, remote: 4ce40f5aca24
@@ -667,8 +653,6 @@
   --
   test L:nm a b R:up a b W:   - 18 merge b no ancestor
   --
-unmatched files new in both:
- b
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: 02963e448370+, remote: 8dbce441892a
@@ -711,8 +695,6 @@
   --
   test L:up a b R:nm a b W:   - 19 merge b no ancestor, prompt remove a
   --
-unmatched files new in both:
- b
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: 0b76e65c8289+, remote: bdb19105162a
@@ -929,9 +911,6 @@
  3/g
  4/g
  7/f
-unmatched files new in both:
- 0/f
- 1/g
 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
  src: '1/f' -> dst: '1/g' *
  src: '3/f' -> dst: '3/g' *
diff --git a/tests/test-graft.t b/tests/test-graft.t
--- a/tests/test-graft.t
+++ b/tests/test-graft.t
@@ -737,8 +737,6 @@
   $ hg graft -q 13 --debug
   scanning for duplicate grafts
   grafting 13:7a4785234d87 "2"
-unmatched files new in both:
- b
 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
  src: 'a' -> dst: 'b' *
 checking for directory renames
diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -625,9 +625,6 @@
 else:
 divergeset.update(fl) # reverse map for below
 
-if bothnew:
-repo.ui.debug("  unmatched files new in both:\n   %s\n"
-  % "\n   ".join(bothnew))
 bothdiverge = {}
 bothincompletediverge = {}
 remainder = {}



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6246: copies: fix up "fullcopy" with missing entries from "copy"

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
martinvonz updated this revision to Diff 14820.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6246?vs=14774=14820

REVISION DETAIL
  https://phab.mercurial-scm.org/D6246

AFFECTED FILES
  mercurial/copies.py
  tests/test-graft.t
  tests/test-rename-merge2.t

CHANGE DETAILS

diff --git a/tests/test-rename-merge2.t b/tests/test-rename-merge2.t
--- a/tests/test-rename-merge2.t
+++ b/tests/test-rename-merge2.t
@@ -365,6 +365,9 @@
 searching for copies back to rev 1
 unmatched files new in both:
  b
+all copies found (* = to merge, ! = divergent, % = renamed and deleted):
+ src: 'a' -> dst: 'b' *
+checking for directory renames
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: 62e7bf090eba+, remote: 49b6d8032493
@@ -952,6 +955,7 @@
  0/f
  1/g
 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
+ src: '1/f' -> dst: '1/g' *
  src: '3/f' -> dst: '3/g' *
  src: '4/f' -> dst: '4/g' *
  src: '5/f' -> dst: '5/g' *
diff --git a/tests/test-graft.t b/tests/test-graft.t
--- a/tests/test-graft.t
+++ b/tests/test-graft.t
@@ -749,6 +749,9 @@
  g
 unmatched files new in both:
  b
+all copies found (* = to merge, ! = divergent, % = renamed and deleted):
+ src: 'a' -> dst: 'b' *
+checking for directory renames
   resolving manifests
branchmerge: True, force: True, partial: False
ancestor: b592ea63bb0c, local: 7e61b508e709+, remote: 7a4785234d87
diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -687,6 +687,10 @@
 for dst, src in fullcopy.copy().items():
 if src not in mb:
 del fullcopy[dst]
+# Sometimes we forget to add entries from "copy" to "fullcopy", so fix
+# that up here
+for dst, src in copy.items():
+fullcopy[dst] = src
 if fullcopy and repo.ui.debugflag:
 repo.ui.debug("  all copies found (* = to merge, ! = divergent, "
   "% = renamed and deleted):\n")



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6248: copies: move early return for "no copies" case a little earlier

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
martinvonz updated this revision to Diff 14822.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6248?vs=14776=14822

REVISION DETAIL
  https://phab.mercurial-scm.org/D6248

AFFECTED FILES
  mercurial/copies.py

CHANGE DETAILS

diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -696,7 +696,11 @@
 for src, dsts in diverge.items():
 for dst in dsts:
 fullcopy[dst] = src
-if fullcopy and repo.ui.debugflag:
+
+if not fullcopy:
+return copy, {}, diverge, renamedelete, {}
+
+if repo.ui.debugflag:
 repo.ui.debug("  all copies found (* = to merge, ! = divergent, "
   "% = renamed and deleted):\n")
 for f in sorted(fullcopy):
@@ -711,9 +715,6 @@
   note))
 del divergeset
 
-if not fullcopy:
-return copy, {}, diverge, renamedelete, {}
-
 repo.ui.debug("  checking for directory renames\n")
 
 # generate a directory move map



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6244: copies: don't include copies that are not in source in directory move

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
martinvonz updated this revision to Diff 14819.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6244?vs=14772=14819

REVISION DETAIL
  https://phab.mercurial-scm.org/D6244

AFFECTED FILES
  mercurial/copies.py
  tests/test-merge-criss-cross.t

CHANGE DETAILS

diff --git a/tests/test-merge-criss-cross.t b/tests/test-merge-criss-cross.t
--- a/tests/test-merge-criss-cross.t
+++ b/tests/test-merge-criss-cross.t
@@ -423,17 +423,10 @@
  d1/b
 unmatched files in other:
  d2/b
-all copies found (* = to merge, ! = divergent, % = renamed and deleted):
- src: 'd1/b' -> dst: 'd2/b' 
-checking for directory renames
- discovered dir src: 'd1/' -> dst: 'd2/'
- pending file src: 'd1/a' -> dst: 'd2/a'
- pending file src: 'd1/b' -> dst: 'd2/b'
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 11b5b303e36c, local: c0ef19750a22+, remote: 6ca01f7342b9
-   d2/a: remote directory rename - move from d1/a -> dm
-   d2/b: remote directory rename, both created -> m
+   d2/b: remote created -> g
   
   calculating bids for ancestor 154e6000f54e
 searching for copies back to rev 3
@@ -453,8 +446,7 @@
   auction for merging merge bids
d1/a: consensus for r
d1/b: consensus for r
-   d2/a: consensus for dm
-   d2/b: picking 'get' action
+   d2/b: consensus for g
   end of auction
   
d1/a: other deleted -> r
diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -682,6 +682,11 @@
 if len(fl) == 2 and fl[0] == fl[1]:
 copy[fl[0]] = of # not actually divergent, just matching renames
 
+# Sometimes we get invalid copies here (the "and not remotebase" in
+# _checkcopies() seems suspicious). Filter them out.
+for dst, src in fullcopy.copy().items():
+if src not in mb:
+del fullcopy[dst]
 if fullcopy and repo.ui.debugflag:
 repo.ui.debug("  all copies found (* = to merge, ! = divergent, "
   "% = renamed and deleted):\n")



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6247: copies: fix up "fullcopy" with missing entries from "diverge"

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
martinvonz updated this revision to Diff 14821.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6247?vs=14775=14821

REVISION DETAIL
  https://phab.mercurial-scm.org/D6247

AFFECTED FILES
  mercurial/copies.py

CHANGE DETAILS

diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -691,6 +691,11 @@
 # that up here
 for dst, src in copy.items():
 fullcopy[dst] = src
+# Sometimes we forget to add entries from "diverge" to "fullcopy", so fix
+# that up here
+for src, dsts in diverge.items():
+for dst in dsts:
+fullcopy[dst] = src
 if fullcopy and repo.ui.debugflag:
 repo.ui.debug("  all copies found (* = to merge, ! = divergent, "
   "% = renamed and deleted):\n")



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6252: tests: make merge conflicts explicit in `hg annotate` tests

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG7116fc614cfc: tests: make merge conflicts explicit in `hg 
annotate` tests (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6252?vs=14780=14815

REVISION DETAIL
  https://phab.mercurial-scm.org/D6252

AFFECTED FILES
  tests/test-annotate.t
  tests/test-fastannotate-hg.t
  tests/test-fastannotate-perfhack.t
  tests/test-fastannotate-protocol.t
  tests/test-fastannotate.t

CHANGE DETAILS

diff --git a/tests/test-fastannotate.t b/tests/test-fastannotate.t
--- a/tests/test-fastannotate.t
+++ b/tests/test-fastannotate.t
@@ -3,8 +3,6 @@
   > fastannotate=
   > EOF
 
-  $ HGMERGE=true; export HGMERGE
-
   $ hg init repo
   $ cd repo
 
diff --git a/tests/test-fastannotate-protocol.t 
b/tests/test-fastannotate-protocol.t
--- a/tests/test-fastannotate-protocol.t
+++ b/tests/test-fastannotate-protocol.t
@@ -7,8 +7,6 @@
   > mainbranch=@
   > EOF
 
-  $ HGMERGE=true; export HGMERGE
-
 setup the server repo
 
   $ hg init repo-server
diff --git a/tests/test-fastannotate-perfhack.t 
b/tests/test-fastannotate-perfhack.t
--- a/tests/test-fastannotate-perfhack.t
+++ b/tests/test-fastannotate-perfhack.t
@@ -5,8 +5,6 @@
   > perfhack=1
   > EOF
 
-  $ HGMERGE=true; export HGMERGE
-
   $ hg init repo
   $ cd repo
 
diff --git a/tests/test-fastannotate-hg.t b/tests/test-fastannotate-hg.t
--- a/tests/test-fastannotate-hg.t
+++ b/tests/test-fastannotate-hg.t
@@ -1,6 +1,8 @@
 (this file is backported from core hg tests/test-annotate.t)
 
   $ cat >> $HGRCPATH << EOF
+  > [ui]
+  > merge = :merge3
   > [diff]
   > git=1
   > [extensions]
@@ -11,8 +13,6 @@
   > mainbranch=.
   > EOF
 
-  $ HGMERGE=true; export HGMERGE
-
 init
 
   $ hg init repo
@@ -157,8 +157,34 @@
   created new head
   $ hg merge
   merging b
-  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-  (branch merge, don't forget to commit)
+  warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
+  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to 
abandon
+  [1]
+  $ cat b
+  a
+  a
+  a
+  <<< working copy: 5fbdc1152d97 - test: b2.1
+  b4
+  c
+  b5
+  ||| base
+  ===
+  b4
+  b5
+  b6
+  >>> merge rev:37ec9f5c3d1f - test: b2
+  $ cat < b
+  > a
+  > a
+  > a
+  > b4
+  > c
+  > b5
+  > EOF
+  $ hg resolve --mark -q
+  $ rm b.orig
   $ hg ci -mmergeb -d '3 0'
 
 annotate after merge
@@ -247,15 +273,37 @@
   > EOF
   $ hg ci -mc -d '3 0'
   created new head
+BROKEN: 'a' was copied to 'b' on both sides. We should not get a merge 
conflict here
   $ hg merge
   merging b
-  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-  (branch merge, don't forget to commit)
-  $ cat <> b
+  warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
+  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to 
abandon
+  [1]
+  $ cat b
+  <<< working copy: b80e3e32f75a - test: c
+  a
+  z
+  a
+  ||| base
+  ===
+  a
+  a
+  a
+  b4
+  c
+  b5
+  >>> merge rev:64afcdf8e29e - test: mergeb
+  $ cat < b
+  > a
+  > z
+  > a
   > b4
   > c
   > b5
   > EOF
+  $ hg resolve --mark -q
+  $ rm b.orig
   $ echo d >> b
   $ hg ci -mmerge2 -d '4 0'
 
@@ -745,14 +793,28 @@
   $ echo 3 >> a
   $ hg commit -m 3 -q
   $ hg merge 2 -q
+  warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
+  [1]
+  $ cat a
+  <<< working copy: 0a068f0261cf - test: 3
+  1
+  2
+  3
+  ||| base
+  1
+  2
+  ===
+  a
+  >>> merge rev:9409851bc20a - test: a
   $ cat > a << EOF
   > b
   > 1
   > 2
   > 3
   > a
   > EOF
   $ hg resolve --mark -q
+  $ rm a.orig
   $ hg commit -m m
   $ hg annotate a
   4: b
diff --git a/tests/test-annotate.t b/tests/test-annotate.t
--- a/tests/test-annotate.t
+++ b/tests/test-annotate.t
@@ -1,4 +1,7 @@
-  $ HGMERGE=true; export HGMERGE
+  $ cat >> "$HGRCPATH" << EOF
+  > [ui]
+  > merge = :merge3
+  > EOF
 
 init
 
@@ -210,8 +213,34 @@
   created new head
   $ hg merge
   merging b
-  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-  (branch merge, don't forget to commit)
+  warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
+  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to 
abandon
+  [1]
+  $ cat b
+  a
+  a
+  a
+  <<< working copy: 5fbdc1152d97 - test: b2.1
+  b4
+  c
+  b5
+  ||| base
+  ===
+  b4
+  b5
+  b6
+  >>> merge rev:37ec9f5c3d1f - test: b2
+  $ cat < b
+  > a
+  > a
+  > a
+  > b4
+  > c
+  > b5
+  > EOF
+  $ hg resolve --mark -q
+  $ rm b.orig
   $ hg ci -mmergeb -d '3 0'
 
 annotate after merge
@@ 

D6243: tests: split out separate test for issue5020

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGf2fe7cf4ebb6: tests: split out separate test for issue5020 
(authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6243?vs=14771=14818

REVISION DETAIL
  https://phab.mercurial-scm.org/D6243

AFFECTED FILES
  tests/test-merge-criss-cross.t

CHANGE DETAILS

diff --git a/tests/test-merge-criss-cross.t b/tests/test-merge-criss-cross.t
--- a/tests/test-merge-criss-cross.t
+++ b/tests/test-merge-criss-cross.t
@@ -11,15 +11,9 @@
 
   $ hg up -qr0
   $ echo '2 first change' > f2
-  $ mkdir d1
-  $ echo '0 base' > d1/f3
-  $ echo '0 base' > d1/f4
-  $ hg add -q d1
   $ hg ci -qm '2 first change f2'
 
   $ hg merge -qr 1
-  $ hg rm d1/f3
-  $ hg mv -q d1 d2
   $ hg ci -m '3 merge'
 
   $ hg up -qr2
@@ -30,38 +24,38 @@
   $ hg ci -m '5 second change f1'
 
   $ hg up -r3
-  2 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ echo '6 second change' > f2
   $ hg ci -m '6 second change f2'
 
   $ hg log -G
-  @  changeset:   6:6373bbfdae1d
+  @  changeset:   6:3b08d01b0ab5
   |  tag: tip
-  |  parent:  3:c202c8af058d
+  |  parent:  3:cf89f02107e5
   |  user:test
   |  date:Thu Jan 01 00:00:00 1970 +
   |  summary: 6 second change f2
   |
-  | o  changeset:   5:e673248094b1
+  | o  changeset:   5:adfe50279922
   | |  user:test
   | |  date:Thu Jan 01 00:00:00 1970 +
   | |  summary: 5 second change f1
   | |
-  | ochangeset:   4:177f58377c06
-  | |\   parent:  2:d1d156401c1b
+  | ochangeset:   4:7d3e55501ae6
+  | |\   parent:  2:40663881a6dd
   | | |  parent:  1:0f6b37dbe527
   | | |  user:test
   | | |  date:Thu Jan 01 00:00:00 1970 +
   | | |  summary: 4 merge
   | | |
-  o---+  changeset:   3:c202c8af058d
-  | | |  parent:  2:d1d156401c1b
+  o---+  changeset:   3:cf89f02107e5
+  | | |  parent:  2:40663881a6dd
   |/ /   parent:  1:0f6b37dbe527
   | |user:test
   | |date:Thu Jan 01 00:00:00 1970 +
   | |summary: 3 merge
   | |
-  | o  changeset:   2:d1d156401c1b
+  | o  changeset:   2:40663881a6dd
   | |  parent:  0:40494bf2444c
   | |  user:test
   | |  date:Thu Jan 01 00:00:00 1970 +
@@ -79,51 +73,27 @@
   
 
   $ hg merge -v --debug --tool internal:dump 5 --config 
merge.preferancestor='!'
-  note: using 0f6b37dbe527 as ancestor of 6373bbfdae1d and e673248094b1
-alternatively, use --config merge.preferancestor=d1d156401c1b
+  note: using 0f6b37dbe527 as ancestor of 3b08d01b0ab5 and adfe50279922
+alternatively, use --config merge.preferancestor=40663881a6dd
 searching for copies back to rev 3
-unmatched files in local:
- d2/f4
-unmatched files in other:
- d1/f3
- d1/f4
-all copies found (* = to merge, ! = divergent, % = renamed and deleted):
- src: 'd1/f4' -> dst: 'd2/f4' 
-checking for directory renames
- discovered dir src: 'd1/' -> dst: 'd2/'
- pending file src: 'd1/f3' -> dst: 'd2/f3'
- pending file src: 'd1/f4' -> dst: 'd2/f4'
   resolving manifests
branchmerge: True, force: False, partial: False
-   ancestor: 0f6b37dbe527, local: 6373bbfdae1d+, remote: e673248094b1
-   preserving d2/f4 for resolve of d2/f4
+   ancestor: 0f6b37dbe527, local: 3b08d01b0ab5+, remote: adfe50279922
preserving f2 for resolve of f2
f1: remote is newer -> g
   getting f1
-   d2/f3: local directory rename - get from d1/f3 -> dg
-  getting d1/f3 to d2/f3
-   d2/f4: local directory rename, both created -> m (premerge)
f2: versions differ -> m (premerge)
   picked tool ':dump' for f2 (binary False symlink False changedelete False)
   merging f2
-  my f2@6373bbfdae1d+ other f2@e673248094b1 ancestor f2@0f6b37dbe527
+  my f2@3b08d01b0ab5+ other f2@adfe50279922 ancestor f2@0f6b37dbe527
f2: versions differ -> m (merge)
   picked tool ':dump' for f2 (binary False symlink False changedelete False)
-  my f2@6373bbfdae1d+ other f2@e673248094b1 ancestor f2@0f6b37dbe527
-  3 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  my f2@3b08d01b0ab5+ other f2@adfe50279922 ancestor f2@0f6b37dbe527
+  1 files updated, 0 files merged, 0 files removed, 1 files unresolved
   use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to 
abandon
   [1]
 
-  $ f --dump --recurse *
-  d2: directory with 2 files
-  d2/f3:
-  >>>
-  0 base
-  <<<
-  d2/f4:
-  >>>
-  0 base
-  <<<
+  $ f --dump *
   f1:
   >>>
   5 second change
@@ -151,85 +121,49 @@
 
   $ hg up -qC .
   $ hg merge -v --tool internal:dump 5 --config merge.preferancestor="null 
40663881 3b08d"
-  note: using 0f6b37dbe527 as ancestor of 6373bbfdae1d and e673248094b1
-alternatively, use --config merge.preferancestor=d1d156401c1b
+  note: using 

D6254: tests: avoid a rename/delete conflict when updating in test-narrow-update.t

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG351cbda889db: tests: avoid a rename/delete conflict when 
updating in test-narrow-update.t (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6254?vs=14782=14817

REVISION DETAIL
  https://phab.mercurial-scm.org/D6254

AFFECTED FILES
  tests/test-narrow-update.t

CHANGE DETAILS

diff --git a/tests/test-narrow-update.t b/tests/test-narrow-update.t
--- a/tests/test-narrow-update.t
+++ b/tests/test-narrow-update.t
@@ -72,5 +72,5 @@
 
   $ hg mv inside/f1 inside/f2
   $ hg update -q 'desc("modify outside")'
-  $ hg update -q 'desc("initial")'
+  $ hg update -q 'desc("add inside and outside")'
   $ hg update -q 'desc("modify inside")'



To: martinvonz, durin42, #hg-reviewers, marmoute, pulkit
Cc: marmoute, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6253: tests: delete unused function in test-rename-merge2.t

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG344066b54a7b: tests: delete unused function in 
test-rename-merge2.t (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6253?vs=14781=14816

REVISION DETAIL
  https://phab.mercurial-scm.org/D6253

AFFECTED FILES
  tests/test-rename-merge2.t

CHANGE DETAILS

diff --git a/tests/test-rename-merge2.t b/tests/test-rename-merge2.t
--- a/tests/test-rename-merge2.t
+++ b/tests/test-rename-merge2.t
@@ -68,7 +68,6 @@
   > hg add $2 2> /dev/null
   > fi
   > }
-  $ uc() { up $1; hg cp $1 $2; } # update + copy
   $ um() { up $1; hg mv $1 $2; }
   $ nc() { hg cp $1 $2; } # just copy
   $ nm() { hg mv $1 $2; } # just move



To: martinvonz, #hg-reviewers, marmoute, pulkit
Cc: marmoute, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6264: narrow: make warning about possibly dirty files respect ui.relative-paths

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG770f5f586ae5: narrow: make warning about possibly dirty 
files respect ui.relative-paths (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6264?vs=14802=14814

REVISION DETAIL
  https://phab.mercurial-scm.org/D6264

AFFECTED FILES
  mercurial/narrowspec.py

CHANGE DETAILS

diff --git a/mercurial/narrowspec.py b/mercurial/narrowspec.py
--- a/mercurial/narrowspec.py
+++ b/mercurial/narrowspec.py
@@ -15,6 +15,7 @@
 match as matchmod,
 merge,
 repository,
+scmutil,
 sparse,
 util,
 )
@@ -302,8 +303,9 @@
 else:
 trackeddirty.extend(lookup)
 _deletecleanfiles(repo, clean)
+uipathfn = scmutil.getuipathfn(repo)
 for f in sorted(trackeddirty):
-repo.ui.status(_('not deleting possibly dirty file %s\n') % f)
+repo.ui.status(_('not deleting possibly dirty file %s\n') % 
uipathfn(f))
 for f in clean + trackeddirty:
 ds.drop(f)
 



To: martinvonz, #hg-reviewers, pulkit
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6255: copies: calculate mergecopies() based on pathcopies()

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment.


  In https://phab.mercurial-scm.org/D6255#91146, @martinvonz wrote:
  
  > In https://phab.mercurial-scm.org/D6255#91019, @martinvonz wrote:
  >
  > > In https://phab.mercurial-scm.org/D6255#91015, @marmoute wrote:
  > >
  > > >
  > >
  > >
  > > Since this seems the very same code as the previous clause, I wonder if 
  > >  we could factor it out. This would help to prevent subtle bug when we 
  > >  update it. (the answer might be "no because python is slow).
  >
  >
  > Yes, I also considered that. I wasn't sure what a good name for the method 
would be and I gave up. I'll try again.
  
  
  I've picked a name and done the refactoring now.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6255

To: martinvonz, #hg-reviewers
Cc: marmoute, mjpieters, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6255: copies: calculate mergecopies() based on pathcopies()

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
martinvonz updated this revision to Diff 14809.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6255?vs=14804=14809

REVISION DETAIL
  https://phab.mercurial-scm.org/D6255

AFFECTED FILES
  mercurial/copies.py
  tests/test-annotate.t
  tests/test-copies.t
  tests/test-fastannotate-hg.t
  tests/test-graft.t
  tests/test-rename-merge2.t

CHANGE DETAILS

diff --git a/tests/test-rename-merge2.t b/tests/test-rename-merge2.t
--- a/tests/test-rename-merge2.t
+++ b/tests/test-rename-merge2.t
@@ -433,6 +433,9 @@
   --
   test L:nc a b R:up b   W:   - 12 merge b no ancestor
   --
+all copies found (* = to merge, ! = divergent, % = renamed and deleted):
+ src: 'a' -> dst: 'b' 
+checking for directory renames
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: 86a2aa42fc76+, remote: af30c7647fc7
@@ -469,6 +472,9 @@
   --
   test L:up b   R:nm a b W:   - 13 merge b no ancestor
   --
+all copies found (* = to merge, ! = divergent, % = renamed and deleted):
+ src: 'a' -> dst: 'b' 
+checking for directory renames
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: 59318016310c+, remote: bdb19105162a
@@ -506,6 +512,9 @@
   --
   test L:nc a b R:up a b W:   - 14 merge b no ancestor
   --
+all copies found (* = to merge, ! = divergent, % = renamed and deleted):
+ src: 'a' -> dst: 'b' 
+checking for directory renames
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: 86a2aa42fc76+, remote: 8dbce441892a
@@ -543,6 +552,9 @@
   --
   test L:up b   R:nm a b W:   - 15 merge b no ancestor, remove a
   --
+all copies found (* = to merge, ! = divergent, % = renamed and deleted):
+ src: 'a' -> dst: 'b' 
+checking for directory renames
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: 59318016310c+, remote: bdb19105162a
@@ -580,6 +592,9 @@
   --
   test L:nc a b R:up a b W:   - 16 get a, merge b no ancestor
   --
+all copies found (* = to merge, ! = divergent, % = renamed and deleted):
+ src: 'a' -> dst: 'b' 
+checking for directory renames
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: 86a2aa42fc76+, remote: 8dbce441892a
@@ -617,6 +632,9 @@
   --
   test L:up a b R:nc a b W:   - 17 keep a, merge b no ancestor
   --
+all copies found (* = to merge, ! = divergent, % = renamed and deleted):
+ src: 'a' -> dst: 'b' 
+checking for directory renames
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: 0b76e65c8289+, remote: 4ce40f5aca24
@@ -653,6 +671,9 @@
   --
   test L:nm a b R:up a b W:   - 18 merge b no ancestor
   --
+all copies found (* = to merge, ! = divergent, % = renamed and deleted):
+ src: 'a' -> dst: 'b' 
+checking for directory renames
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: 02963e448370+, remote: 8dbce441892a
@@ -695,6 +716,9 @@
   --
   test L:up a b R:nm a b W:   - 19 merge b no ancestor, prompt remove a
   --
+all copies found (* = to merge, ! = divergent, % = renamed and deleted):
+ src: 'a' -> dst: 'b' 
+checking for directory renames
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: 0b76e65c8289+, remote: bdb19105162a
diff --git a/tests/test-graft.t b/tests/test-graft.t
--- a/tests/test-graft.t
+++ b/tests/test-graft.t
@@ -75,6 +75,8 @@
 
   $ hg graft -r 2 --base 3
   grafting 2:5c095ad7e90f "2"
+  note: possible conflict - c was deleted and renamed to:
+   a
   note: graft of 2:5c095ad7e90f created no changes to commit
 
 Can't continue without starting:
@@ -220,6 +222,9 @@
   committing changelog
   updating the branch cache
   grafting 5:97f8bfe72746 "5"
+all copies found (* = to merge, ! = divergent, % = renamed and deleted):
+ src: 'c' -> dst: 'b' 
+checking for directory renames
   resolving manifests
branchmerge: True, force: True, partial: False
ancestor: 4c60f11aa304, local: 6b9e5368ca4e+, remote: 97f8bfe72746
@@ -233,6 +238,9 @@
   $ HGEDITOR=cat hg graft 4 3 --log --debug
   scanning for duplicate grafts
   grafting 4:9c233e8e184d "4"
+all copies found (* = to merge, ! = divergent, % = renamed and deleted):
+ src: 'c' -> dst: 'b' 
+checking for directory renames
   resolving manifests
branchmerge: True, force: True, partial: False
ancestor: 4c60f11aa304, local: 1905859650ec+, remote: 9c233e8e184d
@@ -1129,7 +1137,6 @@
   grafting 

D6269: copies: ignore heuristics copytracing when using changeset-centric algos

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6269

AFFECTED FILES
  mercurial/copies.py

CHANGE DETAILS

diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -415,6 +415,10 @@
 # value, so we should rely on making sure copytracing is on such cases
 return {}, {}, {}, {}, {}
 
+if usechangesetcentricalgo(repo):
+# The heuristics don't make sense when we need changeset-centric algos
+return _fullcopytracing(repo, c1, c2, base)
+
 # Copy trace disabling is explicitly below the node == p1 logic above
 # because the logic above is required for a simple copy to be kept across a
 # rebase.



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6256: copies: inline _computenonoverlap() in mergecopies()

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
martinvonz updated this revision to Diff 14810.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6256?vs=14805=14810

REVISION DETAIL
  https://phab.mercurial-scm.org/D6256

AFFECTED FILES
  hgext/remotefilelog/__init__.py
  mercurial/copies.py
  tests/test-remotefilelog-sparse.t

CHANGE DETAILS

diff --git a/tests/test-remotefilelog-sparse.t 
b/tests/test-remotefilelog-sparse.t
--- a/tests/test-remotefilelog-sparse.t
+++ b/tests/test-remotefilelog-sparse.t
@@ -98,12 +98,5 @@
   $ clearcache
   $ hg prefetch -r '. + .^' -I x -I z
   4 files fetched over 1 fetches - (4 misses, 0.00% hit ratio) over * (glob)
-Originally this was testing that the rebase doesn't fetch pointless
-blobs. Right now it fails because core's sparse can't load a spec from
-the working directory. Presumably there's a fix, but I'm not sure what it is.
   $ hg rebase -d 2 --keep
   rebasing 1:876b1317060d "x2" (foo)
-  transaction abort!
-  rollback completed
-  abort: cannot parse sparse patterns from working directory
-  [255]
diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -353,26 +353,6 @@
 return _chain(x, y, _backwardrenames(x, a, match=match),
   _forwardcopies(a, y, match=match))
 
-def _computenonoverlap(repo, c1, c2, addedinm1, addedinm2, debug=True):
-"""Computes, based on addedinm1 and addedinm2, the files exclusive to c1
-and c2. This is its own function so extensions can easily wrap this call
-to see what files mergecopies is about to process.
-
-Even though c1 and c2 are not used in this function, they are useful in
-other extensions for being able to read the file nodes of the changed 
files.
-"""
-u1 = sorted(addedinm1 - addedinm2)
-u2 = sorted(addedinm2 - addedinm1)
-
-if debug:
-header = "  unmatched files in %s"
-if u1:
-repo.ui.debug("%s:\n   %s\n" % (header % 'local', "\n   
".join(u1)))
-if u2:
-repo.ui.debug("%s:\n   %s\n" % (header % 'other', "\n   
".join(u2)))
-
-return u1, u2
-
 def mergecopies(repo, c1, c2, base):
 """
 Finds moves and copies between context c1 and c2 that are relevant for
@@ -550,7 +530,14 @@
 # find interesting file sets from manifests
 addedinm1 = m1.filesnotin(mb, repo.narrowmatch())
 addedinm2 = m2.filesnotin(mb, repo.narrowmatch())
-u1, u2 = _computenonoverlap(repo, c1, c2, addedinm1, addedinm2)
+u1 = sorted(addedinm1 - addedinm2)
+u2 = sorted(addedinm2 - addedinm1)
+
+header = "  unmatched files in %s"
+if u1:
+repo.ui.debug("%s:\n   %s\n" % (header % 'local', "\n   ".join(u1)))
+if u2:
+repo.ui.debug("%s:\n   %s\n" % (header % 'other', "\n   ".join(u2)))
 
 fullcopy = copies1.copy()
 fullcopy.update(copies2)
diff --git a/hgext/remotefilelog/__init__.py b/hgext/remotefilelog/__init__.py
--- a/hgext/remotefilelog/__init__.py
+++ b/hgext/remotefilelog/__init__.py
@@ -487,37 +487,6 @@
 return orig(repo, matcher, added, removed, *args, **kwargs)
 extensions.wrapfunction(scmutil, '_findrenames', findrenames)
 
-# prefetch files before mergecopies check
-def computenonoverlap(orig, repo, c1, c2, *args, **kwargs):
-u1, u2 = orig(repo, c1, c2, *args, **kwargs)
-if isenabled(repo):
-m1 = c1.manifest()
-m2 = c2.manifest()
-files = []
-
-sparsematch1 = repo.maybesparsematch(c1.rev())
-if sparsematch1:
-sparseu1 = set()
-for f in u1:
-if sparsematch1(f):
-files.append((f, hex(m1[f])))
-sparseu1.add(f)
-u1 = sparseu1
-
-sparsematch2 = repo.maybesparsematch(c2.rev())
-if sparsematch2:
-sparseu2 = set()
-for f in u2:
-if sparsematch2(f):
-files.append((f, hex(m2[f])))
-sparseu2.add(f)
-u2 = sparseu2
-
-# batch fetch the needed files from the server
-repo.fileservice.prefetch(files)
-return u1, u2
-extensions.wrapfunction(copies, '_computenonoverlap', computenonoverlap)
-
 # prefetch files before pathcopies check
 def computeforwardmissing(orig, a, b, match=None):
 missing = orig(a, b, match=match)



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6268: copies: move check for experimental.copytrace== earlier

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  I'm going to ignore experimental.copytrace when changeset-centric
  algorithms are required. This little refactoring makes that easier to
  add.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6268

AFFECTED FILES
  mercurial/copies.py

CHANGE DETAILS

diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -410,7 +410,10 @@
 return _dirstatecopies(repo, narrowmatch), {}, {}, {}, {}
 
 copytracing = repo.ui.config('experimental', 'copytrace')
-boolctrace = stringutil.parsebool(copytracing)
+if stringutil.parsebool(copytracing) is False:
+# stringutil.parsebool() returns None when it is unable to parse the
+# value, so we should rely on making sure copytracing is on such cases
+return {}, {}, {}, {}, {}
 
 # Copy trace disabling is explicitly below the node == p1 logic above
 # because the logic above is required for a simple copy to be kept across a
@@ -422,10 +425,6 @@
 if _isfullcopytraceable(repo, c1, base):
 return _fullcopytracing(repo, c1, c2, base)
 return _heuristicscopytracing(repo, c1, c2, base)
-elif boolctrace is False:
-# stringutil.parsebool() returns None when it is unable to parse the
-# value, so we should rely on making sure copytracing is on such cases
-return {}, {}, {}, {}, {}
 else:
 return _fullcopytracing(repo, c1, c2, base)
 



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6266: copies: replace .items() by .values() where appropriate

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
martinvonz updated this revision to Diff 14811.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6266?vs=14806=14811

REVISION DETAIL
  https://phab.mercurial-scm.org/D6266

AFFECTED FILES
  mercurial/copies.py

CHANGE DETAILS

diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -522,9 +522,9 @@
 
 renamedeleteset = set()
 divergeset = set()
-for src, dsts in diverge.items():
+for dsts in diverge.values():
 divergeset.update(dsts)
-for src, dsts in renamedelete.items():
+for dsts in renamedelete.values():
 renamedeleteset.update(dsts)
 
 # find interesting file sets from manifests



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6267: incoming: detect if server send partial replies

2019-04-17 Thread indygreg (Gregory Szorc)
indygreg requested changes to this revision.
indygreg added a comment.
This revision now requires changes to proceed.


  +1 for feature. Needs some minor work to get review.

INLINE COMMENTS

> bundlerepo.py:639
>  
> +if rheads and any(x not in localrepo for x in rheads):
> +ui.warn(_("warning: partial reply from server\n"))

`localrepo.__contains__` can be slow in tight loops because it has to resolve 
`self.changelog`. Also, `localrepo.__getitem__` (which `__contains__` calls) 
accepts a myriad of different values (integers, hex and binary hashes, etc). We 
want to user a lower-level API to perform lookups. I think 
`localrepo.changelog.hasnode()` is what we want. Please alias that to a local 
to avoid the `localrepo.changelog` property resolution in a loop.

> bundlerepo.py:640
> +if rheads and any(x not in localrepo for x in rheads):
> +ui.warn(_("warning: partial reply from server\n"))
> +rheads = [x for x in rheads if x in localrepo]

+1 for this feature. But the warning message is a bit ambiguous to me. How 
about something like `warning: server sent partial data; not all remote 
changesets are available`. This still isn't great. But I'm struggling to find a 
way to better state the issue here.

> bundlerepo.py:641
> +ui.warn(_("warning: partial reply from server\n"))
> +rheads = [x for x in rheads if x in localrepo]
>  csets = localrepo.changelog.findmissing(common, rheads)

Same comment as above regarding the `x in localrepo` issues.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6267

To: joerg.sonnenberger, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 2 of 4] verify: introduce a notion of "level"

2019-04-17 Thread Gregory Szorc
On Wed, Apr 17, 2019 at 7:54 AM Pierre-Yves David <
pierre-yves.da...@ens-lyon.org> wrote:

>
>
> On 4/17/19 3:15 PM, Gregory Szorc wrote:
> >
> >
> >> On Apr 17, 2019, at 01:38, Pierre-Yves David <
> pierre-yves.da...@ens-lyon.org> wrote:
> >>
> >> # HG changeset patch
> >> # User Pierre-Yves David 
> >> # Date 1555456341 -7200
> >> #  Wed Apr 17 01:12:21 2019 +0200
> >> # Node ID 55bd98999c25b10e220477fd4cc446a7c9c1f8ca
> >> # Parent  f233cb63bc077267d8571378350d9563cbabcf3d
> >> # EXP-Topic verify
> >> # Available At https://bitbucket.org/octobus/mercurial-devel/
> >> #  hg pull https://bitbucket.org/octobus/mercurial-devel/
> -r 55bd98999c25
> >> verify: introduce a notion of "level"
> >>
> >> Some checks are slower than others, to help the user to run the checks
> he needs,
> >> we are about to introduce new flag to select faster vs deeper runs.
> This put
> >> the scaffolding in place to do this.
> >
> > I’m in favor of customizing verify behavior: it is an overdue feature
> IMO.
> >
> > Experience tells me that shoehorning things into a numeric level will be
> fragile and won’t scale well. I’m wondering if we should introduce
> individual “feature flags” / arguments to control what is verified. That
> will make the code a bit cleaner and easier to separate IMO. If we want to
> map a number to a set of verify options, we can do that too.
> >
> > This idea is scope bloat. But something tells me we’ll regret the
> limitations of numeric levels in the future. I’d rather pass in a set of
> things to verify. This is also more extensible.
>
> I agree with you on the general principle (being able to select what we
> check for. I also agree that it is outside the scope of this small
> series. (I documented the checks earlier this cycle, so we will have
> something to start from).
>
> I am not sure if you are requesting changes here or not. The internal
> implementation can be changed later and the flag is experimental, so
> everything in this series can be adjusted later.
>
> Do you have specific changes in mind to get this series in ?
>

I have no major objections to using a numeric level for now. But if any
more complexity is added, it might be best to do something more flexible
sooner rather than later.


>
>
> >
> >>
> >> diff --git a/mercurial/hg.py b/mercurial/hg.py
> >> --- a/mercurial/hg.py
> >> +++ b/mercurial/hg.py
> >> @@ -1092,9 +1092,9 @@ def outgoing(ui, repo, dest, opts):
> >>  recurse()
> >>  return 0 # exit code is zero since we found outgoing changes
> >>
> >> -def verify(repo):
> >> +def verify(repo, level=None):
> >>  """verify the consistency of a repository"""
> >> -ret = verifymod.verify(repo)
> >> +ret = verifymod.verify(repo, level=level)
> >>
> >>  # Broken subrepo references in hidden csets don't seem worth
> worrying about,
> >>  # since they can't be pushed/pulled, and --hidden can be used if
> they are a
> >> diff --git a/mercurial/verify.py b/mercurial/verify.py
> >> --- a/mercurial/verify.py
> >> +++ b/mercurial/verify.py
> >> @@ -22,9 +22,12 @@ from . import (
> >>  util,
> >> )
> >>
> >> -def verify(repo):
> >> +VERIFY_DEFAULT = 0
> >> +
> >> +def verify(repo, level=None):
> >>  with repo.lock():
> >> -return verifier(repo).verify()
> >> +v = verifier(repo, level)
> >> +return v.verify()
> >>
> >> def _normpath(f):
> >>  # under hg < 2.4, convert didn't sanitize paths properly, so a
> >> @@ -34,10 +37,13 @@ def _normpath(f):
> >>  return f
> >>
> >> class verifier(object):
> >> -def __init__(self, repo):
> >> +def __init__(self, repo, level=None):
> >>  self.repo = repo.unfiltered()
> >>  self.ui = repo.ui
> >>  self.match = repo.narrowmatch()
> >> +if level is None:
> >> +level = VERIFY_DEFAULT
> >> +self._level = level
> >>  self.badrevs = set()
> >>  self.errors = 0
> >>  self.warnings = 0
> >> ___
> >> Mercurial-devel mailing list
> >> Mercurial-devel@mercurial-scm.org
> >> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
> --
> Pierre-Yves David
>
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 1 of 2 V2] peer: introduce a limitedarguments attributes

2019-04-17 Thread Martin von Zweigbergk via Mercurial-devel
On Wed, Apr 17, 2019 at 2:33 PM Joerg Sonnenberger  wrote:

> On Wed, Apr 17, 2019 at 11:33:45AM -0700, Martin von Zweigbergk via
> Mercurial-devel wrote:
> > Question 3: Does httppostargs switch GET requests to POST requests?
> >
> > I believe the answer is "no".
>
> See makev1commandrest in httppeer.py line 137ff. The answer is "yes, if
> they exist".
>

Thanks. That's a clear answer to my original question.


>
> Joerg
> ___
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6267: incoming: detect if server send partial replies

2019-04-17 Thread joerg.sonnenberger (Joerg Sonnenberger)
joerg.sonnenberger created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  incoming is not using the normal exchange logic and therefore doesn't
  know how to tell with pullbundles. Fixing that is involved and it is
  currently not sure if the current incoming code will survive, so apply a
  band aid for now.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6267

AFFECTED FILES
  mercurial/bundlerepo.py
  tests/test-pull-bundle.t

CHANGE DETAILS

diff --git a/tests/test-pull-bundle.t b/tests/test-pull-bundle.t
--- a/tests/test-pull-bundle.t
+++ b/tests/test-pull-bundle.t
@@ -136,20 +136,21 @@
   updating to branch default
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd repo.pullbundle2a
-  $ hg incoming -r ed1b79f46b9a
+  $ hg incoming
   comparing with http://localhost:$HGPORT2/
   searching for changes
-  changeset:   1:ed1b79f46b9a
+  warning: partial reply from server
+  changeset:   1:effea6de0384
   tag: tip
   user:test
   date:Thu Jan 01 00:00:00 1970 +
-  summary: change foo
+  summary: add bar
   
   $ cd ..
   $ killdaemons.py
   $ grep 'sending pullbundle ' repo/.hg/blackbox.log
   * sending pullbundle "0.hg" (glob)
-  * sending pullbundle "1.hg" (glob)
+  * sending pullbundle "2.hg" (glob)
   $ rm repo/.hg/blackbox.log
 
 Test recovery from misconfigured server sending no new data
diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py
--- a/mercurial/bundlerepo.py
+++ b/mercurial/bundlerepo.py
@@ -636,6 +636,9 @@
 # The discovery process probably need cleanup to avoid that
 localrepo = localrepo.unfiltered()
 
+if rheads and any(x not in localrepo for x in rheads):
+ui.warn(_("warning: partial reply from server\n"))
+rheads = [x for x in rheads if x in localrepo]
 csets = localrepo.changelog.findmissing(common, rheads)
 
 if bundlerepo:



To: joerg.sonnenberger, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 1 of 2 V2] peer: introduce a limitedarguments attributes

2019-04-17 Thread Joerg Sonnenberger
On Wed, Apr 17, 2019 at 11:33:45AM -0700, Martin von Zweigbergk via 
Mercurial-devel wrote:
> Question 3: Does httppostargs switch GET requests to POST requests?
> 
> I believe the answer is "no".

See makev1commandrest in httppeer.py line 137ff. The answer is "yes, if
they exist".

Joerg
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6265: narrow: also warn when not deleting untracked or ignored files

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
martinvonz updated this revision to Diff 14807.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6265?vs=14803=14807

REVISION DETAIL
  https://phab.mercurial-scm.org/D6265

AFFECTED FILES
  mercurial/narrowspec.py
  tests/test-narrow-share.t

CHANGE DETAILS

diff --git a/tests/test-narrow-share.t b/tests/test-narrow-share.t
--- a/tests/test-narrow-share.t
+++ b/tests/test-narrow-share.t
@@ -28,6 +28,9 @@
   $ hg clone --narrow ssh://user@dummy/remote main -q \
   > --include d1 --include d3 --include d5 --include d7
 
+Ignore file called "ignored"
+  $ echo ignored > main/.hgignore
+
   $ hg share main share
   updating working directory
   4 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -55,15 +58,19 @@
 # Make d3/f dirty
   $ echo x >> main/d3/f
   $ echo y >> main/d3/g
+  $ touch main/d3/ignored
+  $ touch main/d3/untracked
   $ hg add main/d3/g
   $ hg -R main st
   M d3/f
   A d3/g
+  ? d3/untracked
 # Make d5/f not match the dirstate timestamp even though it's clean
   $ sleep 2
   $ hg -R main st
   M d3/f
   A d3/g
+  ? d3/untracked
   $ hg -R main debugdirstate --no-dates
   n 644  2 set d1/f
   n 644  2 set d3/f
@@ -91,14 +98,18 @@
   not deleting possibly dirty file d3/f
   not deleting possibly dirty file d3/g
   not deleting possibly dirty file d5/f
+  not deleting unknown file d3/untracked
+  not deleting ignored file d3/ignored
 # d1/f, d3/f, d3/g and d5/f should no longer be reported
   $ hg -R main files
   main/d7/f
 # d1/f should no longer be there, d3/f should be since it was dirty, d3/g 
should be there since
 # it was added, and d5/f should be since we couldn't be sure it was clean
   $ find main/d* -type f | sort
   main/d3/f
   main/d3/g
+  main/d3/ignored
+  main/d3/untracked
   main/d5/f
   main/d7/f
 
@@ -131,6 +142,8 @@
   $ hg -R main st --all
   M d3/f
   ? d3/g
+  ? d3/untracked
+  I d3/ignored
   C d1/f
   C d7/f
 
diff --git a/mercurial/narrowspec.py b/mercurial/narrowspec.py
--- a/mercurial/narrowspec.py
+++ b/mercurial/narrowspec.py
@@ -293,8 +293,8 @@
 removedmatch = matchmod.differencematcher(oldmatch, newmatch)
 
 ds = repo.dirstate
-lookup, status = ds.status(removedmatch, subrepos=[], ignored=False,
-   clean=True, unknown=False)
+lookup, status = ds.status(removedmatch, subrepos=[], ignored=True,
+   clean=True, unknown=True)
 trackeddirty = status.modified + status.added
 clean = status.clean
 if assumeclean:
@@ -306,6 +306,10 @@
 uipathfn = scmutil.getuipathfn(repo)
 for f in sorted(trackeddirty):
 repo.ui.status(_('not deleting possibly dirty file %s\n') % 
uipathfn(f))
+for f in sorted(status.unknown):
+repo.ui.status(_('not deleting unknown file %s\n') % uipathfn(f))
+for f in sorted(status.ignored):
+repo.ui.status(_('not deleting ignored file %s\n') % uipathfn(f))
 for f in clean + trackeddirty:
 ds.drop(f)
 



To: martinvonz, durin42, #hg-reviewers
Cc: rdamazio, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6265: narrow: also warn when not deleting untracked or ignored files

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
martinvonz added inline comments.

INLINE COMMENTS

> rdamazio wrote in narrowspec.py:310
> Just do a loop for each one? You probably also don't need them to be sets.

I did it that way at first. Then I changed it because I figured it might be a 
harder to read if dirty, untracked, and ignored files in single a directory 
were spread out in three places. OTOH, both `hg status` and `hg revert` already 
do it that way, so I guess we should follow them. I'll change it back here.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6265

To: martinvonz, durin42, #hg-reviewers
Cc: rdamazio, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6255: copies: calculate mergecopies() based on pathcopies()

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
martinvonz updated this revision to Diff 14804.
martinvonz edited the summary of this revision.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6255?vs=14783=14804

REVISION DETAIL
  https://phab.mercurial-scm.org/D6255

AFFECTED FILES
  mercurial/copies.py
  tests/test-annotate.t
  tests/test-copies.t
  tests/test-fastannotate-hg.t
  tests/test-graft.t
  tests/test-rename-merge2.t

CHANGE DETAILS

diff --git a/tests/test-rename-merge2.t b/tests/test-rename-merge2.t
--- a/tests/test-rename-merge2.t
+++ b/tests/test-rename-merge2.t
@@ -433,6 +433,9 @@
   --
   test L:nc a b R:up b   W:   - 12 merge b no ancestor
   --
+all copies found (* = to merge, ! = divergent, % = renamed and deleted):
+ src: 'a' -> dst: 'b' 
+checking for directory renames
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: 86a2aa42fc76+, remote: af30c7647fc7
@@ -469,6 +472,9 @@
   --
   test L:up b   R:nm a b W:   - 13 merge b no ancestor
   --
+all copies found (* = to merge, ! = divergent, % = renamed and deleted):
+ src: 'a' -> dst: 'b' 
+checking for directory renames
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: 59318016310c+, remote: bdb19105162a
@@ -506,6 +512,9 @@
   --
   test L:nc a b R:up a b W:   - 14 merge b no ancestor
   --
+all copies found (* = to merge, ! = divergent, % = renamed and deleted):
+ src: 'a' -> dst: 'b' 
+checking for directory renames
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: 86a2aa42fc76+, remote: 8dbce441892a
@@ -543,6 +552,9 @@
   --
   test L:up b   R:nm a b W:   - 15 merge b no ancestor, remove a
   --
+all copies found (* = to merge, ! = divergent, % = renamed and deleted):
+ src: 'a' -> dst: 'b' 
+checking for directory renames
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: 59318016310c+, remote: bdb19105162a
@@ -580,6 +592,9 @@
   --
   test L:nc a b R:up a b W:   - 16 get a, merge b no ancestor
   --
+all copies found (* = to merge, ! = divergent, % = renamed and deleted):
+ src: 'a' -> dst: 'b' 
+checking for directory renames
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: 86a2aa42fc76+, remote: 8dbce441892a
@@ -617,6 +632,9 @@
   --
   test L:up a b R:nc a b W:   - 17 keep a, merge b no ancestor
   --
+all copies found (* = to merge, ! = divergent, % = renamed and deleted):
+ src: 'a' -> dst: 'b' 
+checking for directory renames
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: 0b76e65c8289+, remote: 4ce40f5aca24
@@ -653,6 +671,9 @@
   --
   test L:nm a b R:up a b W:   - 18 merge b no ancestor
   --
+all copies found (* = to merge, ! = divergent, % = renamed and deleted):
+ src: 'a' -> dst: 'b' 
+checking for directory renames
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: 02963e448370+, remote: 8dbce441892a
@@ -695,6 +716,9 @@
   --
   test L:up a b R:nm a b W:   - 19 merge b no ancestor, prompt remove a
   --
+all copies found (* = to merge, ! = divergent, % = renamed and deleted):
+ src: 'a' -> dst: 'b' 
+checking for directory renames
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: 0b76e65c8289+, remote: bdb19105162a
diff --git a/tests/test-graft.t b/tests/test-graft.t
--- a/tests/test-graft.t
+++ b/tests/test-graft.t
@@ -75,6 +75,8 @@
 
   $ hg graft -r 2 --base 3
   grafting 2:5c095ad7e90f "2"
+  note: possible conflict - c was deleted and renamed to:
+   a
   note: graft of 2:5c095ad7e90f created no changes to commit
 
 Can't continue without starting:
@@ -220,6 +222,9 @@
   committing changelog
   updating the branch cache
   grafting 5:97f8bfe72746 "5"
+all copies found (* = to merge, ! = divergent, % = renamed and deleted):
+ src: 'c' -> dst: 'b' 
+checking for directory renames
   resolving manifests
branchmerge: True, force: True, partial: False
ancestor: 4c60f11aa304, local: 6b9e5368ca4e+, remote: 97f8bfe72746
@@ -233,6 +238,9 @@
   $ HGEDITOR=cat hg graft 4 3 --log --debug
   scanning for duplicate grafts
   grafting 4:9c233e8e184d "4"
+all copies found (* = to merge, ! = divergent, % = renamed and deleted):
+ src: 'c' -> dst: 'b' 
+checking for directory renames
   resolving manifests
branchmerge: True, force: True, partial: False
ancestor: 4c60f11aa304, local: 1905859650ec+, remote: 

D6256: copies: inline _computenonoverlap() in mergecopies()

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
martinvonz updated this revision to Diff 14805.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6256?vs=14785=14805

REVISION DETAIL
  https://phab.mercurial-scm.org/D6256

AFFECTED FILES
  hgext/remotefilelog/__init__.py
  mercurial/copies.py
  tests/test-remotefilelog-sparse.t

CHANGE DETAILS

diff --git a/tests/test-remotefilelog-sparse.t 
b/tests/test-remotefilelog-sparse.t
--- a/tests/test-remotefilelog-sparse.t
+++ b/tests/test-remotefilelog-sparse.t
@@ -98,12 +98,5 @@
   $ clearcache
   $ hg prefetch -r '. + .^' -I x -I z
   4 files fetched over 1 fetches - (4 misses, 0.00% hit ratio) over * (glob)
-Originally this was testing that the rebase doesn't fetch pointless
-blobs. Right now it fails because core's sparse can't load a spec from
-the working directory. Presumably there's a fix, but I'm not sure what it is.
   $ hg rebase -d 2 --keep
   rebasing 1:876b1317060d "x2" (foo)
-  transaction abort!
-  rollback completed
-  abort: cannot parse sparse patterns from working directory
-  [255]
diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -353,26 +353,6 @@
 return _chain(x, y, _backwardrenames(x, a, match=match),
   _forwardcopies(a, y, match=match))
 
-def _computenonoverlap(repo, c1, c2, addedinm1, addedinm2, debug=True):
-"""Computes, based on addedinm1 and addedinm2, the files exclusive to c1
-and c2. This is its own function so extensions can easily wrap this call
-to see what files mergecopies is about to process.
-
-Even though c1 and c2 are not used in this function, they are useful in
-other extensions for being able to read the file nodes of the changed 
files.
-"""
-u1 = sorted(addedinm1 - addedinm2)
-u2 = sorted(addedinm2 - addedinm1)
-
-if debug:
-header = "  unmatched files in %s"
-if u1:
-repo.ui.debug("%s:\n   %s\n" % (header % 'local', "\n   
".join(u1)))
-if u2:
-repo.ui.debug("%s:\n   %s\n" % (header % 'other', "\n   
".join(u2)))
-
-return u1, u2
-
 def mergecopies(repo, c1, c2, base):
 """
 Finds moves and copies between context c1 and c2 that are relevant for
@@ -558,7 +538,14 @@
 # find interesting file sets from manifests
 addedinm1 = m1.filesnotin(mb, repo.narrowmatch())
 addedinm2 = m2.filesnotin(mb, repo.narrowmatch())
-u1, u2 = _computenonoverlap(repo, c1, c2, addedinm1, addedinm2)
+u1 = sorted(addedinm1 - addedinm2)
+u2 = sorted(addedinm2 - addedinm1)
+
+header = "  unmatched files in %s"
+if u1:
+repo.ui.debug("%s:\n   %s\n" % (header % 'local', "\n   ".join(u1)))
+if u2:
+repo.ui.debug("%s:\n   %s\n" % (header % 'other', "\n   ".join(u2)))
 
 fullcopy = copies1.copy()
 fullcopy.update(copies2)
diff --git a/hgext/remotefilelog/__init__.py b/hgext/remotefilelog/__init__.py
--- a/hgext/remotefilelog/__init__.py
+++ b/hgext/remotefilelog/__init__.py
@@ -487,37 +487,6 @@
 return orig(repo, matcher, added, removed, *args, **kwargs)
 extensions.wrapfunction(scmutil, '_findrenames', findrenames)
 
-# prefetch files before mergecopies check
-def computenonoverlap(orig, repo, c1, c2, *args, **kwargs):
-u1, u2 = orig(repo, c1, c2, *args, **kwargs)
-if isenabled(repo):
-m1 = c1.manifest()
-m2 = c2.manifest()
-files = []
-
-sparsematch1 = repo.maybesparsematch(c1.rev())
-if sparsematch1:
-sparseu1 = set()
-for f in u1:
-if sparsematch1(f):
-files.append((f, hex(m1[f])))
-sparseu1.add(f)
-u1 = sparseu1
-
-sparsematch2 = repo.maybesparsematch(c2.rev())
-if sparsematch2:
-sparseu2 = set()
-for f in u2:
-if sparsematch2(f):
-files.append((f, hex(m2[f])))
-sparseu2.add(f)
-u2 = sparseu2
-
-# batch fetch the needed files from the server
-repo.fileservice.prefetch(files)
-return u1, u2
-extensions.wrapfunction(copies, '_computenonoverlap', computenonoverlap)
-
 # prefetch files before pathcopies check
 def computeforwardmissing(orig, a, b, match=None):
 missing = orig(a, b, match=match)



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6266: copies: replace .items() by .values() where appropriate

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  As pointed out by Pierre-Yves.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6266

AFFECTED FILES
  mercurial/copies.py

CHANGE DETAILS

diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -530,9 +530,9 @@
 
 renamedeleteset = set()
 divergeset = set()
-for src, dsts in diverge.items():
+for dsts in diverge.values():
 divergeset.update(dsts)
-for src, dsts in renamedelete.items():
+for dsts in renamedelete.values():
 renamedeleteset.update(dsts)
 
 # find interesting file sets from manifests



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6254: tests: avoid a rename/delete conflict when updating in test-narrow-update.t

2019-04-17 Thread marmoute (Pierre-Yves David)
marmoute accepted this revision.
marmoute added a comment.


  This one seems simple and sensible.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6254

To: martinvonz, durin42, #hg-reviewers, marmoute
Cc: marmoute, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6253: tests: delete unused function in test-rename-merge2.t

2019-04-17 Thread marmoute (Pierre-Yves David)
marmoute added a comment.


  That one seems simple and sensible too.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6253

To: martinvonz, #hg-reviewers
Cc: marmoute, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6252: tests: make merge conflicts explicit in `hg annotate` tests

2019-04-17 Thread marmoute (Pierre-Yves David)
marmoute accepted this revision.
marmoute added a comment.


  This one seems simple and sensible.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6252

To: martinvonz, #hg-reviewers, marmoute
Cc: marmoute, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6265: narrow: also warn when not deleting untracked or ignored files

2019-04-17 Thread rdamazio (Rodrigo Damazio Bovendorp)
rdamazio added inline comments.

INLINE COMMENTS

> narrowspec.py:310
> +for f in sorted(trackeddirty + status.unknown + status.ignored):
> +if f in unknownset:
> +repo.ui.status(_('not deleting unknown file %s\n') % uipathfn(f))

Just do a loop for each one? You probably also don't need them to be sets.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6265

To: martinvonz, durin42, #hg-reviewers
Cc: rdamazio, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6255: copies: calculate mergecopies() based on pathcopies()

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment.


  In https://phab.mercurial-scm.org/D6255#91019, @martinvonz wrote:
  
  > In https://phab.mercurial-scm.org/D6255#91015, @marmoute wrote:
  >
  > >
  >
  >
  > The rest somehow didn't make it here, so I'll copy from the email (i.e. the 
below is from Pierre-Yves, not from me):
  >
  > >    
  >
  > on related topic, you seems to be fixing a case in 
  >  test-fastannotate-hg.t and test-annotate-hg.t that is probably worth 
  >  mentioning.
  
  
  Sure, I'll add that.
  
  > 
  > 
  >>     One drawback of the rewritten code is that we may now make
  >>     remotefilelog prefetch more files. We used to prefetch files that were
  >>     unique to either side of the merge compared to the other. We now
  >>     prefetch files that are unique to either sise of the merge compared to
  > 
  > sise → side
  
  Thanks, done.
  
  >>     Some timings for calculating mergecopies between two revisions (all
  >>     using the common ancestor as base):
  > 
  > Which revisions did you pick?
  
  I've tried to clarify this in the commit message.
  
  >>     So it's measurably slower in most cases. Note that merge copies are
  >>     not calculated when updating with a clean working copy, which is
  >>     probably the most common case. I therefore think the much simpler code
  >>     is worth the slowdown.
  > 
  > Do you know where the slowdown comes from ?
  
  One difference is that the new code ends up calling `adjustlinkrev()` (from 
the `isintroducedafter()` call in `_tracefile()`), which the old code somehow 
avoids. That's your area of expertise, so maybe you can figure it out? I've 
already spent several hours on it without understanding much more than I did 
before.
  
  > 
  > 
  >> +            # TODO: Handle cases where it was renamed on one side and 
copied
  >>  +            # on the other side
  > 
  > Is this TODO a regression or some ported limitation.
  
  It's ported (i.e. it existed before this patch). See commit message of 
https://phab.mercurial-scm.org/D6242.
  
  > 
  > 
  >> +        elif dsts1:
  >>  +            # copied/renamed only on side 1
  >>  +            if src not in m2:
  >>  +                # deleted on side 2
  >>  +                if src not in m1:
  >>  +                    # renamed on side 1, deleted on side 2
  >>  +                    renamedelete[src] = dsts1
  >>  +            elif m2[src] != mb[src]:
  >>  +                # modified on side 2
  >>  +                for dst in dsts1:
  >>  +                    if dst not in m2:
  >>  +                        # dst not added on side 2 (handle as regular
  >>  +                        # "both created" case in manifestmerge in that 
case)
  > 
  > Can you elaborate a bit on what this case means (and how we deal with 
  >  it) especially, what happens if dst is indeed in m2 ?
  
  Oops, I think that was supposed say "otherwise" instead of "in that case". 
I'll fix.
  
  > 
  > 
  >> +                        copy[dst] = src
  >>  +        elif dsts2:
  >>  +            # copied/renamed only on side 2
  >>  +            if src not in m1:
  >>  +                # deleted on side 1
  >>  +                if src not in m2:
  >>  +                    # renamed on side 2, deleted on side 1
  >>  +                    renamedelete[src] = dsts2
  >>  +            elif m1[src] != mb[src]:
  >>  +                # modified on side 1
  >>  +                for dst in dsts2:
  >>  +                    if dst not in m1:
  >>  +                        # dst not added on side 1 (handle as regular
  >>  +                        # "both created" case in manifestmerge in that 
case)
  >>  +                        copy[dst] = src
  > 
  > Since this seems the very same code as the previous clause, I wonder if 
  >  we could factor it out. This would help to prevent subtle bug when we 
  >  update it. (the answer might be "no because python is slow).
  
  Yes, I also considered that. I wasn't sure what a good name for the method 
would be and I gave up. I'll try again.
  
  > 
  > 
  >> +    renamedeleteset = set()
  >>  +    divergeset = set()
  >>  +    for src, dsts in diverge.items():
  >>  +        divergeset.update(dsts)
  >>  +    for src, dsts in renamedelete.items():
  >>  +        renamedeleteset.update(dsts)
  > 
  > small nits: Is there any reason not to use diverge.values and 
  >  renamedelete.values here ?
  
  This is existing code, but I can send a separate patch for that.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6255

To: martinvonz, #hg-reviewers
Cc: marmoute, mjpieters, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


mercurial@42149: 4 new changesets (4 on stable)

2019-04-17 Thread Mercurial Commits
4 new changesets (4 on stable) in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/4a8d9ed86475
changeset:   42146:4a8d9ed86475
branch:  stable
tag: 5.0rc0
parent:  41984:d1c33b2442a7
parent:  42143:29569f2db929
user:Augie Fackler 
date:Wed Apr 17 13:41:18 2019 -0400
summary: merge: default into stable for release candidate

https://www.mercurial-scm.org/repo/hg/rev/807a6ca6d096
changeset:   42147:807a6ca6d096
branch:  stable
user:Augie Fackler 
date:Wed Apr 17 13:56:08 2019 -0400
summary: Added tag 5.0rc0 for changeset 4a8d9ed86475

https://www.mercurial-scm.org/repo/hg/rev/e76eb64d7f71
changeset:   42148:e76eb64d7f71
branch:  stable
user:Augie Fackler 
date:Wed Apr 17 13:56:10 2019 -0400
summary: Added signature for changeset 4a8d9ed86475

https://www.mercurial-scm.org/repo/hg/rev/84b5ad5fc2aa
changeset:   42149:84b5ad5fc2aa
branch:  stable
bookmark:@
tag: tip
parent:  42148:e76eb64d7f71
parent:  42145:607a0de9bae3
user:Augie Fackler 
date:Wed Apr 17 14:10:02 2019 -0400
summary: merge: forgot to pull before release

-- 
Repository URL: https://www.mercurial-scm.org/repo/hg
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6258: packaging: coerce paths to strings

2019-04-17 Thread durin42 (Augie Fackler)
durin42 added a comment.


  In https://phab.mercurial-scm.org/D6258#91056, @indygreg wrote:
  
  > In https://phab.mercurial-scm.org/D6258#91055, @durin42 wrote:
  >
  > > Argh. This change appears to be wrong (!) so I'm going to drop it.
  >
  >
  > Eh? I don't see anything wrong with this. Casting a `pathlib.Path` to `str` 
should just work! In fact, it is necessary for older Python 3, as there was a 
long tail of stdlib functions that didn't accept `pathlib.*` when those types 
were first introduced. I believe 3.7 was the first release that fixed them all.
  
  
  At least one of the archive libraries can't cope with a destination being a 
Path but a source being a str, or something like that. zipfile can't (AFAICT) 
cope with Path objects on Python 3.5, but I worked around that by finding a 
Windows image at work that came with 3.7 already installed. :)

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6258

To: durin42, #hg-reviewers, pulkit
Cc: indygreg, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 1 of 2 V2] peer: introduce a limitedarguments attributes

2019-04-17 Thread Martin von Zweigbergk via Mercurial-devel
On Wed, Apr 17, 2019 at 10:41 AM Pierre-Yves David <
pierre-yves.da...@ens-lyon.org> wrote:

>
>
> On 4/17/19 7:17 PM, Martin von Zweigbergk wrote:
> >
> >
> > On Wed, Apr 17, 2019 at 10:07 AM Pierre-Yves David
> > mailto:pierre-yves.da...@ens-lyon.org>>
>
> > wrote:
> >
> > # HG changeset patch
> > # User Pierre-Yves David  > >
> > # Date 116590 -7200
> > #  Wed Apr 17 17:56:30 2019 +0200
> > # Node ID 6882a0101d389e27d697bf2e9717de176f273309
> > # Parent  607a0de9bae31df526da75b68ab2853787d8c31e
> > # EXP-Topic discovery-speedup
> > # Available At https://bitbucket.org/octobus/mercurial-devel/
> > #  hg pull
> > https://bitbucket.org/octobus/mercurial-devel/ -r 6882a0101d38
> > peer: introduce a limitedarguments attributes
> >
> > When set to True, it signal that the peer cannot receive too larges
> > arguments
> > and that algorithm must adapt. This should only be True for http
> > peer that does
> > not support argument passed as "post".
> >
> > This will be useful to unlock better discovery performance in the
> next
> > changesets.
> >
> > I am using a dedicated argument because this is not really a usual
> > "capabilities" things. An alternative approach would be to adds a
> > "large-arguments" to all peer, but the http peers. That seemed a bit
> > too hacky
> > to me.
> >
> > diff --git a/mercurial/httppeer.py b/mercurial/httppeer.py
> > --- a/mercurial/httppeer.py
> > +++ b/mercurial/httppeer.py
> > @@ -382,6 +382,7 @@ class httppeer(wireprotov1peer.wirepeer)
> >   self._path = path
> >   self._url = url
> >   self._caps = caps
> > +self.limitedarguments = caps is not None and 'httppostargs'
> > not in caps
>

Should we limit them also if `caps is None`?

>
> >
> > Is `'httppostargs' not in caps` enough to know that httppostargs will be
> > used for the "heads" request?
>
> the `httppostargs` capabilities is http specific and cannot be used
> outside of the httppeer code (for example, ssh server has no argument
> side issue but still won't says they are httppostargs capable).
>
> (note: we are talking about the `known` command heres, `heads` takes no
> arguments)
>
> > As I said in an earlier email, I'm not
> > sure it will be respected for GET requests (and "heads" is a GET
> > request, right?). Did you check that this will not result in a GET
> request?
>
> I am a bit confused about what you mean here. `known` will be included
> into a batch command (or standalone for quite older server).  that
> command will be get of post according to `httppostargs`, won't it?
>
> I don't think I understood what your final question is. Can you try again?
>

Question 1: Do "heads" and "known" request normally use GET or POST
(without this patch, without batching)?

I believe the answer is "GET".

Question 2: Do "batch" requests use POST?

I believe the answer is "yes".

Question 3: Does httppostargs switch GET requests to POST requests?

I believe the answer is "no".

Together, that seems to mean that we now rely on the requests getting
batched for the httppostargs thing to take effect. Correct? If correct, it
seems we should also check if the server supports batching before we decide
to remove the limit. We should also add a comment to the with-block where
we call "heads" and "known" so someone knows that we rely on batching there
for it to work.


>
>
>
> --
> Pierre-Yves David
>
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 2 of 4 V2] verify: introduce a notion of "level"

2019-04-17 Thread Pierre-Yves David



On 4/17/19 8:04 PM, Martin von Zweigbergk wrote:



On Wed, Apr 17, 2019 at 6:27 AM Pierre-Yves David 
mailto:pierre-yves.da...@ens-lyon.org>> 
wrote:




On 4/17/19 3:18 PM, Martin von Zweigbergk wrote:
 >
 >
 > On Wed, Apr 17, 2019, 03:49 Pierre-Yves David
 > mailto:pierre-yves.da...@ens-lyon.org>
>>
 > wrote:
 >
 >     # HG changeset patch
 >     # User Pierre-Yves David mailto:pierre-yves.da...@octobus.net>
 >     >>
 >     # Date 1555456341 -7200
 >     #      Wed Apr 17 01:12:21 2019 +0200
 >     # Node ID 55bd98999c25b10e220477fd4cc446a7c9c1f8ca
 >     # Parent  f233cb63bc077267d8571378350d9563cbabcf3d
 >     # EXP-Topic verify
 >     # Available At https://bitbucket.org/octobus/mercurial-devel/
 >     #              hg pull
 > https://bitbucket.org/octobus/mercurial-devel/ -r 55bd98999c25
 >     verify: introduce a notion of "level"
 >
 >
 > I feel like this is unnecessarily complicated. It feels like just
 > passing a boolean "full" would be enough. If one level has been
enough
 > for over ten years, it seems likely that two levels will be
enough for
 > many years ahead. Or do you plan to add more levels?

I am planning to pass a "quick" mode that only check for stuff like
revlog size.


What about the revlog size would it check?


Mostly the part of the checks that do basic sanity check to the revlog, 
without looking individual revisions: 
https://www.mercurial-scm.org/repo/hg/file/tip/mercurial/verify.py#l79


Only looking at revlog make the proces O(nbfiles) instead of 
O(nbfiles*nbrevs) The checks are also much cheaper


--
Pierre-Yves David
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


mercurial@42145: 2 new changesets

2019-04-17 Thread Mercurial Commits
2 new changesets in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/013de80bf90e
changeset:   42144:013de80bf90e
user:Pierre-Yves David 
date:Wed Apr 17 00:37:00 2019 +0200
summary: recover: add a --[no-]verify flag

https://www.mercurial-scm.org/repo/hg/rev/607a0de9bae3
changeset:   42145:607a0de9bae3
bookmark:@
tag: tip
user:Pierre-Yves David 
date:Tue Apr 16 15:50:20 2019 +0200
summary: debugdiscovery: include the number of heads in all sets

-- 
Repository URL: https://www.mercurial-scm.org/repo/hg
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 2 of 4 V2] verify: introduce a notion of "level"

2019-04-17 Thread Martin von Zweigbergk via Mercurial-devel
On Wed, Apr 17, 2019 at 6:27 AM Pierre-Yves David <
pierre-yves.da...@ens-lyon.org> wrote:

>
>
> On 4/17/19 3:18 PM, Martin von Zweigbergk wrote:
> >
> >
> > On Wed, Apr 17, 2019, 03:49 Pierre-Yves David
> > mailto:pierre-yves.da...@ens-lyon.org>>
>
> > wrote:
> >
> > # HG changeset patch
> > # User Pierre-Yves David  > >
> > # Date 1555456341 -7200
> > #  Wed Apr 17 01:12:21 2019 +0200
> > # Node ID 55bd98999c25b10e220477fd4cc446a7c9c1f8ca
> > # Parent  f233cb63bc077267d8571378350d9563cbabcf3d
> > # EXP-Topic verify
> > # Available At https://bitbucket.org/octobus/mercurial-devel/
> > #  hg pull
> > https://bitbucket.org/octobus/mercurial-devel/ -r 55bd98999c25
> > verify: introduce a notion of "level"
> >
> >
> > I feel like this is unnecessarily complicated. It feels like just
> > passing a boolean "full" would be enough. If one level has been enough
> > for over ten years, it seems likely that two levels will be enough for
> > many years ahead. Or do you plan to add more levels?
>
> I am planning to pass a "quick" mode that only check for stuff like
> revlog size.
>

What about the revlog size would it check?
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6265: narrow: also warn when not deleting untracked or ignored files

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a reviewer: durin42.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6265

AFFECTED FILES
  mercurial/narrowspec.py
  tests/test-narrow-share.t

CHANGE DETAILS

diff --git a/tests/test-narrow-share.t b/tests/test-narrow-share.t
--- a/tests/test-narrow-share.t
+++ b/tests/test-narrow-share.t
@@ -28,6 +28,9 @@
   $ hg clone --narrow ssh://user@dummy/remote main -q \
   > --include d1 --include d3 --include d5 --include d7
 
+Ignore file called "ignored"
+  $ echo ignored > main/.hgignore
+
   $ hg share main share
   updating working directory
   4 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -55,15 +58,19 @@
 # Make d3/f dirty
   $ echo x >> main/d3/f
   $ echo y >> main/d3/g
+  $ touch main/d3/ignored
+  $ touch main/d3/untracked
   $ hg add main/d3/g
   $ hg -R main st
   M d3/f
   A d3/g
+  ? d3/untracked
 # Make d5/f not match the dirstate timestamp even though it's clean
   $ sleep 2
   $ hg -R main st
   M d3/f
   A d3/g
+  ? d3/untracked
   $ hg -R main debugdirstate --no-dates
   n 644  2 set d1/f
   n 644  2 set d3/f
@@ -90,6 +97,8 @@
   $ hg -R main tracked --update-working-copy
   not deleting possibly dirty file d3/f
   not deleting possibly dirty file d3/g
+  not deleting ignored file d3/ignored
+  not deleting unknown file d3/untracked
   not deleting possibly dirty file d5/f
 # d1/f, d3/f, d3/g and d5/f should no longer be reported
   $ hg -R main files
@@ -99,6 +108,8 @@
   $ find main/d* -type f | sort
   main/d3/f
   main/d3/g
+  main/d3/ignored
+  main/d3/untracked
   main/d5/f
   main/d7/f
 
@@ -131,6 +142,8 @@
   $ hg -R main st --all
   M d3/f
   ? d3/g
+  ? d3/untracked
+  I d3/ignored
   C d1/f
   C d7/f
 
diff --git a/mercurial/narrowspec.py b/mercurial/narrowspec.py
--- a/mercurial/narrowspec.py
+++ b/mercurial/narrowspec.py
@@ -293,8 +293,8 @@
 removedmatch = matchmod.differencematcher(oldmatch, newmatch)
 
 ds = repo.dirstate
-lookup, status = ds.status(removedmatch, subrepos=[], ignored=False,
-   clean=True, unknown=False)
+lookup, status = ds.status(removedmatch, subrepos=[], ignored=True,
+   clean=True, unknown=True)
 trackeddirty = status.modified + status.added
 clean = status.clean
 if assumeclean:
@@ -304,8 +304,16 @@
 trackeddirty.extend(lookup)
 _deletecleanfiles(repo, clean)
 uipathfn = scmutil.getuipathfn(repo)
-for f in sorted(trackeddirty):
-repo.ui.status(_('not deleting possibly dirty file %s\n') % 
uipathfn(f))
+unknownset = set(status.unknown)
+ignoredset = set(status.ignored)
+for f in sorted(trackeddirty + status.unknown + status.ignored):
+if f in unknownset:
+repo.ui.status(_('not deleting unknown file %s\n') % uipathfn(f))
+elif f in ignoredset:
+repo.ui.status(_('not deleting ignored file %s\n') % uipathfn(f))
+else:
+repo.ui.status(_('not deleting possibly dirty file %s\n') %
+   uipathfn(f))
 for f in clean + trackeddirty:
 ds.drop(f)
 



To: martinvonz, durin42, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6264: narrow: make warning about dirty possibly files respect ui.relative-paths

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6264

AFFECTED FILES
  mercurial/narrowspec.py

CHANGE DETAILS

diff --git a/mercurial/narrowspec.py b/mercurial/narrowspec.py
--- a/mercurial/narrowspec.py
+++ b/mercurial/narrowspec.py
@@ -15,6 +15,7 @@
 match as matchmod,
 merge,
 repository,
+scmutil,
 sparse,
 util,
 )
@@ -302,8 +303,9 @@
 else:
 trackeddirty.extend(lookup)
 _deletecleanfiles(repo, clean)
+uipathfn = scmutil.getuipathfn(repo)
 for f in sorted(trackeddirty):
-repo.ui.status(_('not deleting possibly dirty file %s\n') % f)
+repo.ui.status(_('not deleting possibly dirty file %s\n') % 
uipathfn(f))
 for f in clean + trackeddirty:
 ds.drop(f)
 



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 1 of 2 V2] peer: introduce a limitedarguments attributes

2019-04-17 Thread Pierre-Yves David



On 4/17/19 7:17 PM, Martin von Zweigbergk wrote:



On Wed, Apr 17, 2019 at 10:07 AM Pierre-Yves David 
mailto:pierre-yves.da...@ens-lyon.org>> 
wrote:


# HG changeset patch
# User Pierre-Yves David mailto:pierre-yves.da...@octobus.net>>
# Date 116590 -7200
#      Wed Apr 17 17:56:30 2019 +0200
# Node ID 6882a0101d389e27d697bf2e9717de176f273309
# Parent  607a0de9bae31df526da75b68ab2853787d8c31e
# EXP-Topic discovery-speedup
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull
https://bitbucket.org/octobus/mercurial-devel/ -r 6882a0101d38
peer: introduce a limitedarguments attributes

When set to True, it signal that the peer cannot receive too larges
arguments
and that algorithm must adapt. This should only be True for http
peer that does
not support argument passed as "post".

This will be useful to unlock better discovery performance in the next
changesets.

I am using a dedicated argument because this is not really a usual
"capabilities" things. An alternative approach would be to adds a
"large-arguments" to all peer, but the http peers. That seemed a bit
too hacky
to me.

diff --git a/mercurial/httppeer.py b/mercurial/httppeer.py
--- a/mercurial/httppeer.py
+++ b/mercurial/httppeer.py
@@ -382,6 +382,7 @@ class httppeer(wireprotov1peer.wirepeer)
          self._path = path
          self._url = url
          self._caps = caps
+        self.limitedarguments = caps is not None and 'httppostargs'
not in caps


Is `'httppostargs' not in caps` enough to know that httppostargs will be 
used for the "heads" request?


the `httppostargs` capabilities is http specific and cannot be used 
outside of the httppeer code (for example, ssh server has no argument 
side issue but still won't says they are httppostargs capable).


(note: we are talking about the `known` command heres, `heads` takes no 
arguments)


As I said in an earlier email, I'm not 
sure it will be respected for GET requests (and "heads" is a GET 
request, right?). Did you check that this will not result in a GET request?


I am a bit confused about what you mean here. `known` will be included 
into a batch command (or standalone for quite older server).  that 
command will be get of post according to `httppostargs`, won't it?


I don't think I understood what your final question is. Can you try again?



--
Pierre-Yves David
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 2 of 2] setdiscovery: stop limiting the number of local head we initially send

2019-04-17 Thread Martin von Zweigbergk via Mercurial-devel
On Tue, Apr 16, 2019 at 8:59 PM Martin von Zweigbergk 
wrote:

>
>
> On Tue, Apr 16, 2019 at 11:41 AM Pierre-Yves David <
> pierre-yves.da...@ens-lyon.org> wrote:
>
>> # HG changeset patch
>> # User Pierre-Yves David 
>> # Date 1555428398 -7200
>> #  Tue Apr 16 17:26:38 2019 +0200
>> # Node ID ffaa98def33a903f132ec4177d36823a741b6ef6
>> # Parent  017778a4463a8e6ecb4b17cacf46a3ab27bdb239
>> # EXP-Topic discovery-speedup
>> # Available At https://bitbucket.org/octobus/mercurial-devel/
>> #  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r
>> ffaa98def33a
>> setdiscovery: stop limiting the number of local head we initially send
>>
>
> I think I tried something like this before. I still have a commit in my
> repo.
>

For reference, that patch is https://phab.mercurial-scm.org/D2647.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D2647: setdiscovery: make progress on each connected group each roundtrip

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
martinvonz updated this revision to Diff 14801.
martinvonz retitled this revision from "setdiscovery: include all local heads 
in second "known" request (issue5809)" to "setdiscovery: make progress on each 
connected group each roundtrip".
martinvonz edited the summary of this revision.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2647?vs=6559=14801

REVISION DETAIL
  https://phab.mercurial-scm.org/D2647

AFFECTED FILES
  mercurial/setdiscovery.py
  tests/test-setdiscovery.t

CHANGE DETAILS

diff --git a/tests/test-setdiscovery.t b/tests/test-setdiscovery.t
--- a/tests/test-setdiscovery.t
+++ b/tests/test-setdiscovery.t
@@ -974,20 +974,17 @@
   searching for changes
   taking quick initial sample
   searching: 2 queries
-  query 2; still undecided: 1240, sample size is: 100
+  query 2; still undecided: 1240, sample size is: 260
   sampling from both directions
   searching: 3 queries
-  query 3; still undecided: 1140, sample size is: 200
+  query 3; still undecided: 980, sample size is: 260
   sampling from both directions
   searching: 4 queries
-  query 4; still undecided: \d+, sample size is: 200 (re)
+  query 4; still undecided: \d+, sample size is: \d+ (re)
   sampling from both directions
   searching: 5 queries
-  query 5; still undecided: \d+, sample size is: 200 (re)
-  sampling from both directions
-  searching: 6 queries
-  query 6; still undecided: \d+, sample size is: \d+ (re)
-  6 total queries in *.s (glob)
+  query 5; still undecided: 131, sample size is: \d+ (re)
+  5 total queries in *.s (glob)
   elapsed time:  * seconds (glob)
   heads summary:
 total common heads:  1
diff --git a/mercurial/setdiscovery.py b/mercurial/setdiscovery.py
--- a/mercurial/setdiscovery.py
+++ b/mercurial/setdiscovery.py
@@ -219,6 +219,7 @@
 if len(revs) <= size:
 return list(revs)
 sample = set(self._repo.revs('heads(%ld)', revs))
+size = max(size, len(sample))
 
 if len(sample) >= size:
 return _limitsample(sample, size)
@@ -233,6 +234,7 @@
 return list(revs)
 repo = self._repo
 sample = set(repo.revs('heads(%ld)', revs))
+size = max(size, len(sample))
 parentrevs = self._parentsgetter()
 
 # update from heads



To: martinvonz, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 1 of 2 V2] peer: introduce a limitedarguments attributes

2019-04-17 Thread Martin von Zweigbergk via Mercurial-devel
On Wed, Apr 17, 2019 at 10:07 AM Pierre-Yves David <
pierre-yves.da...@ens-lyon.org> wrote:

> # HG changeset patch
> # User Pierre-Yves David 
> # Date 116590 -7200
> #  Wed Apr 17 17:56:30 2019 +0200
> # Node ID 6882a0101d389e27d697bf2e9717de176f273309
> # Parent  607a0de9bae31df526da75b68ab2853787d8c31e
> # EXP-Topic discovery-speedup
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r
> 6882a0101d38
> peer: introduce a limitedarguments attributes
>
> When set to True, it signal that the peer cannot receive too larges
> arguments
> and that algorithm must adapt. This should only be True for http peer that
> does
> not support argument passed as "post".
>
> This will be useful to unlock better discovery performance in the next
> changesets.
>
> I am using a dedicated argument because this is not really a usual
> "capabilities" things. An alternative approach would be to adds a
> "large-arguments" to all peer, but the http peers. That seemed a bit too
> hacky
> to me.
>
> diff --git a/mercurial/httppeer.py b/mercurial/httppeer.py
> --- a/mercurial/httppeer.py
> +++ b/mercurial/httppeer.py
> @@ -382,6 +382,7 @@ class httppeer(wireprotov1peer.wirepeer)
>  self._path = path
>  self._url = url
>  self._caps = caps
> +self.limitedarguments = caps is not None and 'httppostargs' not
> in caps
>

Is `'httppostargs' not in caps` enough to know that httppostargs will be
used for the "heads" request? As I said in an earlier email, I'm not sure
it will be respected for GET requests (and "heads" is a GET request,
right?). Did you check that this will not result in a GET request?


>  self._urlopener = opener
>  self._requestbuilder = requestbuilder
>
> @@ -750,6 +751,9 @@ class httpv2executor(object):
>
>  @interfaceutil.implementer(repository.ipeerv2)
>  class httpv2peer(object):
> +
> +limitedarguments = False
> +
>  def __init__(self, ui, repourl, apipath, opener, requestbuilder,
>   apidescriptor):
>  self.ui = ui
> diff --git a/mercurial/repository.py b/mercurial/repository.py
> --- a/mercurial/repository.py
> +++ b/mercurial/repository.py
> @@ -291,6 +291,10 @@ class ipeercommandexecutor(interfaceutil
>  class ipeerrequests(interfaceutil.Interface):
>  """Interface for executing commands on a peer."""
>
> +limitedarguments = interfaceutil.Attribute(
> +"""True if the peer cannot receive large argument value for
> commands."""
> +)
> +
>  def commandexecutor():
>  """A context manager that resolves to an ipeercommandexecutor.
>
> @@ -329,6 +333,8 @@ class ipeerv2(ipeerconnection, ipeercapa
>  class peer(object):
>  """Base class for peer repositories."""
>
> +limitedarguments = False
> +
>  def capable(self, name):
>  caps = self.capabilities()
>  if name in caps:
>
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6218: narrow: send specs as bundle2 data instead of param (issue5952) (issue6019)

2019-04-17 Thread idlsoft (Sandu Turcan)
idlsoft added a comment.


  If ACL is enabled, processing this part is mandatory, yes.
  On clone, or pull the user doesn't specify includes, so reading this part is 
the only way the client can get them.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6218

To: pulkit, durin42, martinvonz, #hg-reviewers
Cc: indygreg, idlsoft, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 2 of 2 V2] setdiscovery: stop limiting the number of local head we initially send

2019-04-17 Thread Pierre-Yves David
# HG changeset patch
# User Pierre-Yves David 
# Date 1555428398 -7200
#  Tue Apr 16 17:26:38 2019 +0200
# Node ID db6c319c208491e0cc1705b5f09ae7cc50719842
# Parent  6882a0101d389e27d697bf2e9717de176f273309
# EXP-Topic discovery-speedup
# Available At https://bitbucket.org/octobus/mercurial-devel/
#  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 
db6c319c2084
setdiscovery: stop limiting the number of local head we initially send

In our testing this limitation provides now real gain and instead triggers
pathological discovery timing for some repository with many heads.

See inline documentation for details.

Some timing below:

Mozilla try repository, (~1M revs, ~35K heads), discovery between 2 clones with
100 head missing on each side

before:
! wall 1.492111 comb 1.49 user 1.45 sys 0.04 (best of 20)
! wall 1.813992 comb 1.82 user 1.70 sys 0.12 (max of 20)
! wall 1.574326 comb 1.573500 user 1.522000 sys 0.051500 (avg of 20)
! wall 1.572583 comb 1.57 user 1.52 sys 0.05 (median of 20)

after:
! wall 1.147834 comb 1.15 user 1.09 sys 0.06 (best of 20)
! wall 1.449144 comb 1.45 user 1.33 sys 0.12 (max of 20)
! wall 1.204618 comb 1.202500 user 1.146500 sys 0.056000 (avg of 20)
! wall 1.194407 comb 1.19 user 1.14 sys 0.05 (median of 20)


pypy (~100 heads, 317 heads) discovery between clones with only 42 common heads

before:
! wall 0.031653 comb 0.03 user 0.03 sys 0.00 (best of 25)
! wall 0.055719 comb 0.05 user 0.04 sys 0.01 (max of 25)
! wall 0.038939 comb 0.039600 user 0.038400 sys 0.001200 (avg of 25)
! wall 0.038660 comb 0.05 user 0.04 sys 0.01 (median of 25)

after:
! wall 0.018754 comb 0.02 user 0.02 sys 0.00 (best of 49)
! wall 0.034505 comb 0.04 user 0.03 sys 0.01 (max of 49)
! wall 0.019631 comb 0.019796 user 0.018367 sys 0.001429 (avg of 49)
! wall 0.019132 comb 0.02 user 0.02 sys 0.00 (median of 49)


Private repository (~1M revs, ~3K heads), discovery from a strip subset, about
100 changesets to be pulled.

before:
! wall 1.837729 comb 1.84 user 1.79 sys 0.05 (best of 20)
! wall 2.203468 comb 2.20 user 2.10 sys 0.10 (max of 20)
! wall 2.049355 comb 2.048500 user 2.002500 sys 0.046000 (avg of 20)
! wall 2.035315 comb 2.04 user 2.00 sys 0.04 (median of 20)

after:
! wall 0.136598 comb 0.13 user 0.11 sys 0.02 (best of 20)
! wall 0.330519 comb 0.33 user 0.26 sys 0.07 (max of 20)
! wall 0.157254 comb 0.155500 user 0.123000 sys 0.032500 (avg of 20)
! wall 0.149870 comb 0.14 user 0.11 sys 0.03 (median of 20)


Same private repo, discovery between two clone with 500 different heads on each
side:

before:
! wall 2.372919 comb 2.37 user 2.32 sys 0.05 (best of 20)
! wall 2.622422 comb 2.61 user 2.51 sys 0.10 (max of 20)
! wall 2.450135 comb 2.45 user 2.402000 sys 0.048000 (avg of 20)
! wall 2.443896 comb 2.45 user 2.41 sys 0.04 (median of 20)

after:
! wall 0.625497 comb 0.62 user 0.57 sys 0.05 (best of 20)
! wall 0.834723 comb 0.82 user 0.73 sys 0.09 (max of 20)
! wall 0.675725 comb 0.675500 user 0.628000 sys 0.047500 (avg of 20)
! wall 0.671614 comb 0.68 user 0.64 sys 0.04 (median of 20)

diff --git a/mercurial/setdiscovery.py b/mercurial/setdiscovery.py
--- a/mercurial/setdiscovery.py
+++ b/mercurial/setdiscovery.py
@@ -275,9 +275,63 @@ def findcommonheads(ui, local, remote,
 # early exit if we know all the specified remote heads already
 ui.debug("query 1; heads\n")
 roundtrips += 1
-sample = _limitsample(ownheads, initialsamplesize)
-# indices between sample and externalized version must match
-sample = list(sample)
+# We also ask remote about all the local heads. That set can be arbitrarily
+# large, so we used to limit it size to `initialsamplesize`. We no longer
+# do as it proved counter productive. The skipped heads could lead to a
+# large "undecided" set, slower to be clarified than if we asked the
+# question for all heads right away.
+#
+# We are already fetching all server heads using the `heads` commands,
+# sending a equivalent number of heads the other way should not have a
+# significant impact.  In addition, it is very likely that we are going to
+# have to issue "known" request for an equivalent amount of revisions in
+# order to decide if theses heads are common or missing.
+#
+# find a detailled analysis below.
+#
+# Case A: local and server both has few heads
+#
+# Ownheads is below initialsamplesize, limit would not have any effect.
+#
+# Case B: local has few heads and server has many
+#
+# Ownheads is below initialsamplesize, limit would not have any effect.
+#
+# Case C: local and server both has many heads
+#
+# We now transfert 

[PATCH 1 of 2 V2] peer: introduce a limitedarguments attributes

2019-04-17 Thread Pierre-Yves David
# HG changeset patch
# User Pierre-Yves David 
# Date 116590 -7200
#  Wed Apr 17 17:56:30 2019 +0200
# Node ID 6882a0101d389e27d697bf2e9717de176f273309
# Parent  607a0de9bae31df526da75b68ab2853787d8c31e
# EXP-Topic discovery-speedup
# Available At https://bitbucket.org/octobus/mercurial-devel/
#  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 
6882a0101d38
peer: introduce a limitedarguments attributes

When set to True, it signal that the peer cannot receive too larges arguments
and that algorithm must adapt. This should only be True for http peer that does
not support argument passed as "post".

This will be useful to unlock better discovery performance in the next
changesets.

I am using a dedicated argument because this is not really a usual
"capabilities" things. An alternative approach would be to adds a
"large-arguments" to all peer, but the http peers. That seemed a bit too hacky
to me.

diff --git a/mercurial/httppeer.py b/mercurial/httppeer.py
--- a/mercurial/httppeer.py
+++ b/mercurial/httppeer.py
@@ -382,6 +382,7 @@ class httppeer(wireprotov1peer.wirepeer)
 self._path = path
 self._url = url
 self._caps = caps
+self.limitedarguments = caps is not None and 'httppostargs' not in caps
 self._urlopener = opener
 self._requestbuilder = requestbuilder
 
@@ -750,6 +751,9 @@ class httpv2executor(object):
 
 @interfaceutil.implementer(repository.ipeerv2)
 class httpv2peer(object):
+
+limitedarguments = False
+
 def __init__(self, ui, repourl, apipath, opener, requestbuilder,
  apidescriptor):
 self.ui = ui
diff --git a/mercurial/repository.py b/mercurial/repository.py
--- a/mercurial/repository.py
+++ b/mercurial/repository.py
@@ -291,6 +291,10 @@ class ipeercommandexecutor(interfaceutil
 class ipeerrequests(interfaceutil.Interface):
 """Interface for executing commands on a peer."""
 
+limitedarguments = interfaceutil.Attribute(
+"""True if the peer cannot receive large argument value for 
commands."""
+)
+
 def commandexecutor():
 """A context manager that resolves to an ipeercommandexecutor.
 
@@ -329,6 +333,8 @@ class ipeerv2(ipeerconnection, ipeercapa
 class peer(object):
 """Base class for peer repositories."""
 
+limitedarguments = False
+
 def capable(self, name):
 caps = self.capabilities()
 if name in caps:
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6218: narrow: send specs as bundle2 data instead of param (issue5952) (issue6019)

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment.


  In https://phab.mercurial-scm.org/D6218#91121, @idlsoft wrote:
  
  > Because the current client ignores the data completely, the only way to 
force it to fail I think is to change the name of the part.
  >  This would make things cleaner probably, but I'll deal with whatever 
solution you guys settle on.
  
  
  I think bundle2 parts can be marked mandatory (by using uppercase in their 
name?). It seems to me like the ACL part should be mandatory. Is that correct, 
Sandu? So that's a good point and thanks for mentioning that. Pulkit, I think 
it's enough to change the name to be something like `narrow:Spec` or 
`Narrow:spec` (I'm thinking the former since some narrow parts are mandatory 
and some are not and then they all still start with `narrow:`).

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6218

To: pulkit, durin42, martinvonz, #hg-reviewers
Cc: indygreg, idlsoft, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 1 of 2] debugdiscovery: include the number of heads in all sets

2019-04-17 Thread Martin von Zweigbergk via Mercurial-devel
On Tue, Apr 16, 2019 at 11:44 AM Pierre-Yves David <
pierre-yves.da...@ens-lyon.org> wrote:

> # HG changeset patch
> # User Pierre-Yves David 
> # Date 1555422620 -7200
> #  Tue Apr 16 15:50:20 2019 +0200
> # Node ID 017778a4463a8e6ecb4b17cacf46a3ab27bdb239
> # Parent  967c098eed3398d991cbd7f0d48636b575beb711
> # EXP-Topic discovery-speedup
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r
> 017778a4463a
> debugdiscovery: include the number of heads in all sets
>

Queuing this one, thanks.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6218: narrow: send specs as bundle2 data instead of param (issue5952) (issue6019)

2019-04-17 Thread idlsoft (Sandu Turcan)
idlsoft added a comment.


  Because the current client ignores the data completely, the only way to force 
it to fail I think is to change the name of the part.
  This would make things cleaner probably, but I'll deal with whatever solution 
you guys settle on.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6218

To: pulkit, durin42, martinvonz, #hg-reviewers
Cc: indygreg, idlsoft, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[Bug 6120] New: Experimental graphstyle doesn't allow UTF-8 characters

2019-04-17 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=6120

Bug ID: 6120
   Summary: Experimental graphstyle doesn't allow UTF-8 characters
   Product: Mercurial
   Version: 4.9
  Hardware: Macintosh
OS: Mac OS
Status: UNCONFIRMED
  Severity: bug
  Priority: wish
 Component: Mercurial
  Assignee: bugzi...@mercurial-scm.org
  Reporter: hello+mercur...@alind.io
CC: mercurial-devel@mercurial-scm.org

Using:

> [experimental] 
> graphstyle.parent = │

Makes hg log crash with the following error:

> $ hg log
> ** Unknown exception encountered with possibly-broken third-party extension 
> prompt
> ** which supports versions unknown of Mercurial.
> ** Please disable prompt and try your action again.
> ** If that fixes the bug please report it to the extension author.
> ** Python 2.7.16 (default, Mar  4 2019, 09:01:38) [GCC 4.2.1 Compatible Apple 
> LLVM 10.0.0 (clang-1000.11.45.5)]
> ** Mercurial Distributed SCM (version 4.9)
> ** Extensions loaded: rebase, pager, shelve, histedit, extdiff, prompt, 
> mercurial_keyring
> Traceback (most recent call last):
>   File "/usr/local/bin/hg", line 43, in 
> dispatch.run()
>   File 
> "/usr/local/Cellar/mercurial/4.9/lib/python2.7/site-packages/mercurial/dispatch.py",
>  line 99, in run
> status = dispatch(req)
>   File 
> "/usr/local/Cellar/mercurial/4.9/lib/python2.7/site-packages/mercurial/dispatch.py",
>  line 225, in dispatch
> ret = _runcatch(req) or 0
>   File 
> "/usr/local/Cellar/mercurial/4.9/lib/python2.7/site-packages/mercurial/dispatch.py",
>  line 376, in _runcatch
> return _callcatch(ui, _runcatchfunc)
>   File 
> "/usr/local/Cellar/mercurial/4.9/lib/python2.7/site-packages/mercurial/dispatch.py",
>  line 384, in _callcatch
> return scmutil.callcatch(ui, func)
>   File 
> "/usr/local/Cellar/mercurial/4.9/lib/python2.7/site-packages/mercurial/scmutil.py",
>  line 165, in callcatch
> return func()
>   File 
> "/usr/local/Cellar/mercurial/4.9/lib/python2.7/site-packages/mercurial/dispatch.py",
>  line 367, in _runcatchfunc
> return _dispatch(req)
>   File 
> "/usr/local/Cellar/mercurial/4.9/lib/python2.7/site-packages/mercurial/dispatch.py",
>  line 1021, in _dispatch
> cmdpats, cmdoptions)
>   File 
> "/usr/local/Cellar/mercurial/4.9/lib/python2.7/site-packages/mercurial/dispatch.py",
>  line 756, in runcommand
> ret = _runcommand(ui, options, cmd, d)
>   File 
> "/usr/local/Cellar/mercurial/4.9/lib/python2.7/site-packages/hgext/pager.py", 
> line 77, in pagecmd
> return orig(ui, options, cmd, cmdfunc)
>   File 
> "/usr/local/Cellar/mercurial/4.9/lib/python2.7/site-packages/mercurial/dispatch.py",
>  line 1030, in _runcommand
> return cmdfunc()
>   File 
> "/usr/local/Cellar/mercurial/4.9/lib/python2.7/site-packages/mercurial/dispatch.py",
>  line 1018, in 
> d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
>   File 
> "/usr/local/Cellar/mercurial/4.9/lib/python2.7/site-packages/mercurial/util.py",
>  line 1670, in check
> return func(*args, **kwargs)
>   File 
> "/usr/local/Cellar/mercurial/4.9/lib/python2.7/site-packages/mercurial/dispatch.py",
>  line 619, in __call__
> return util.checksignature(self.fn)(ui, *args, **opts)
>   File 
> "/usr/local/Cellar/mercurial/4.9/lib/python2.7/site-packages/mercurial/util.py",
>  line 1670, in check
> return func(*args, **kwargs)
>   File 
> "/usr/local/Cellar/mercurial/4.9/lib/python2.7/site-packages/mercurial/commands.py",
>  line 3884, in log
> displayfn(ui, repo, revs, displayer, getrenamed)
>   File 
> "/usr/local/Cellar/mercurial/4.9/lib/python2.7/site-packages/mercurial/logcmdutil.py",
>  line 887, in displaygraphrevs
> displaygraph(ui, repo, revdag, displayer, graphmod.asciiedges, getrenamed)
>   File 
> "/usr/local/Cellar/mercurial/4.9/lib/python2.7/site-packages/mercurial/logcmdutil.py",
>  line 881, in displaygraph
> graphmod.ascii(ui, state, type, char, lines, coldata)
>   File 
> "/usr/local/Cellar/mercurial/4.9/lib/python2.7/site-packages/mercurial/graphmod.py",
>  line 484, in ascii
> line[:] = [c[-1:] if _drawgp(c, i) else parent for c in line]
>   File 
> "/usr/local/Cellar/mercurial/4.9/lib/python2.7/site-packages/mercurial/graphmod.py",
>  line 480, in _drawgp
> num = int(char[:-1])
> ValueError: invalid literal for int() with base 10: '\xe2\x94'

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 2 of 2] setdiscovery: stop limiting the number of local head we initially send

2019-04-17 Thread Martin von Zweigbergk via Mercurial-devel
On Wed, Apr 17, 2019 at 8:27 AM Pierre-Yves David <
pierre-yves.da...@ens-lyon.org> wrote:

> On 4/17/19 5:21 PM, Martin von Zweigbergk wrote:
> >
> >
> > On Wed, Apr 17, 2019 at 3:36 AM Pierre-Yves David
> > mailto:pierre-yves.da...@ens-lyon.org>>
>
> > wrote:
> >
> > On 4/17/19 5:59 AM, Martin von Zweigbergk wrote:
> >  >
> >  >
> >  > On Tue, Apr 16, 2019 at 11:41 AM Pierre-Yves David
> >  >  > 
> >  > >>
> >  > wrote:
> >  >
> >  > # HG changeset patch
> >  > # User Pierre-Yves David  > 
> >  >  > >>
> >  > # Date 1555428398 -7200
> >  > #  Tue Apr 16 17:26:38 2019 +0200
> >  > # Node ID ffaa98def33a903f132ec4177d36823a741b6ef6
> >  > # Parent  017778a4463a8e6ecb4b17cacf46a3ab27bdb239
> >  > # EXP-Topic discovery-speedup
> >  > # Available At https://bitbucket.org/octobus/mercurial-devel/
> >  > #  hg pull
> >  > https://bitbucket.org/octobus/mercurial-devel/ -r ffaa98def33a
> >  > setdiscovery: stop limiting the number of local head we
> > initially send
> >  >
> >  >
> >  > I think I tried something like this before. I still have a commit
> > in my
> >  > repo. I don't remember why I didn't send it. Perhaps the issue
> > was that
> >  > the heads are sent in HTTP headers and we need to limit the size
> of
> >  > those to work with restrictive proxies and servers?
> >
> > My intuition is that we are going to it that limit later anyway (eg:
> in
> > the getbundle common parameters).
> >
> >
> > IIRC, we split up the HgArgs header when it gets too big. I don't know
> > about the getbundle parameters.
> >
> >
> > What is our way forward here?
> >
> >
> > Perhaps capability-guarded support for putting it in the request body?
> > We already have support for that with experimental.httppostargs. I don't
> > know if that also replaces GET requests by POST requests (and I don't
> > know if the server accepts either method), so perhaps we'll need another
> > capability here. Augie?
>
> On IRC Joerg suguest we could put the limit only for http peers, not
> using the experimental option. I think it is a good idea
>

Yeah, that should work. Sorry, I'm so used to http that i didn't even think
to ask if your customers are using ssh :P


>
> > This provide a large boost that I would
> > rather have in 5.0 core instead of having to patch it all around.
> > Should
> >
> > we hide the behavior behind a config as a start?
> >
> >
> > I'd be fine with making the limits that are currently 100 and 200 both
> > configurable (as experimental options).
>
> These limits have other effects later in the code and we don't want to
> lift them. Removing the limit here is a different story. I'll try the
> Joerg idea.
>
> --
> Pierre-Yves David
>
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 2 of 2] setdiscovery: stop limiting the number of local head we initially send

2019-04-17 Thread Pierre-Yves David

On 4/17/19 5:21 PM, Martin von Zweigbergk wrote:



On Wed, Apr 17, 2019 at 3:36 AM Pierre-Yves David 
mailto:pierre-yves.da...@ens-lyon.org>> 
wrote:


On 4/17/19 5:59 AM, Martin von Zweigbergk wrote:
 >
 >
 > On Tue, Apr 16, 2019 at 11:41 AM Pierre-Yves David
 > mailto:pierre-yves.da...@ens-lyon.org>
>>
 > wrote:
 >
 >     # HG changeset patch
 >     # User Pierre-Yves David mailto:pierre-yves.da...@octobus.net>
 >     >>
 >     # Date 1555428398 -7200
 >     #      Tue Apr 16 17:26:38 2019 +0200
 >     # Node ID ffaa98def33a903f132ec4177d36823a741b6ef6
 >     # Parent  017778a4463a8e6ecb4b17cacf46a3ab27bdb239
 >     # EXP-Topic discovery-speedup
 >     # Available At https://bitbucket.org/octobus/mercurial-devel/
 >     #              hg pull
 > https://bitbucket.org/octobus/mercurial-devel/ -r ffaa98def33a
 >     setdiscovery: stop limiting the number of local head we
initially send
 >
 >
 > I think I tried something like this before. I still have a commit
in my
 > repo. I don't remember why I didn't send it. Perhaps the issue
was that
 > the heads are sent in HTTP headers and we need to limit the size of
 > those to work with restrictive proxies and servers?

My intuition is that we are going to it that limit later anyway (eg: in
the getbundle common parameters).


IIRC, we split up the HgArgs header when it gets too big. I don't know 
about the getbundle parameters.



What is our way forward here?


Perhaps capability-guarded support for putting it in the request body? 
We already have support for that with experimental.httppostargs. I don't 
know if that also replaces GET requests by POST requests (and I don't 
know if the server accepts either method), so perhaps we'll need another 
capability here. Augie?


On IRC Joerg suguest we could put the limit only for http peers, not 
using the experimental option. I think it is a good idea



This provide a large boost that I would
rather have in 5.0 core instead of having to patch it all around.
Should 


we hide the behavior behind a config as a start?


I'd be fine with making the limits that are currently 100 and 200 both 
configurable (as experimental options).


These limits have other effects later in the code and we don't want to 
lift them. Removing the limit here is a different story. I'll try the 
Joerg idea.


--
Pierre-Yves David
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 3 of 4 V3] verify: introduce an experimental --full flag

2019-04-17 Thread Pierre-Yves David
# HG changeset patch
# User Pierre-Yves David 
# Date 1555456269 -7200
#  Wed Apr 17 01:11:09 2019 +0200
# Node ID 9bec7491e9b4cabdfa4d264e5213b1f416ec2607
# Parent  55bd98999c25b10e220477fd4cc446a7c9c1f8ca
# EXP-Topic verify
# Available At https://bitbucket.org/octobus/mercurial-devel/
#  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 
9bec7491e9b4
verify: introduce an experimental --full flag

The flag currently has no effect, see next changeset for details. We introduce
the flag as experimental to keep the freedom of changing our mind on the final
UI.

Note: this patch highlight a small but in `hg help`. An option section is
generated even if no option are visible.

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -63,6 +63,7 @@ from . import (
 tags as tagsmod,
 ui as uimod,
 util,
+verify as verifymod,
 wireprotoserver,
 )
 from .utils import (
@@ -6147,8 +6148,10 @@ def update(ui, repo, node=None, **opts):
 ui.warn("(%s)\n" % obsfatemsg)
 return ret
 
-@command('verify', [], helpcategory=command.CATEGORY_MAINTENANCE)
-def verify(ui, repo):
+@command('verify',
+ [('', 'full', False, 'perform more checks (EXPERIMENTAL)')],
+ helpcategory=command.CATEGORY_MAINTENANCE)
+def verify(ui, repo, **opts):
 """verify the integrity of the repository
 
 Verify the integrity of the current repository.
@@ -6164,7 +6167,10 @@ def verify(ui, repo):
 
 Returns 0 on success, 1 if errors are encountered.
 """
-return hg.verify(repo)
+level = None
+if opts['full']:
+level = verifymod.VERIFY_FULL
+return hg.verify(repo, level)
 
 @command(
 'version', [] + formatteropts, helpcategory=command.CATEGORY_HELP,
diff --git a/mercurial/verify.py b/mercurial/verify.py
--- a/mercurial/verify.py
+++ b/mercurial/verify.py
@@ -23,6 +23,7 @@ from . import (
 )
 
 VERIFY_DEFAULT = 0
+VERIFY_FULL = 1
 
 def verify(repo, level=None):
 with repo.lock():
diff --git a/tests/test-completion.t b/tests/test-completion.t
--- a/tests/test-completion.t
+++ b/tests/test-completion.t
@@ -347,7 +347,7 @@ Show all commands + options
   tip: patch, git, style, template
   unbundle: update
   update: clean, check, merge, date, rev, tool
-  verify: 
+  verify: full
   version: template
 
   $ hg init a
diff --git a/tests/test-help.t b/tests/test-help.t
--- a/tests/test-help.t
+++ b/tests/test-help.t
@@ -615,6 +615,8 @@ Test command without options
   
   Returns 0 on success, 1 if errors are encountered.
   
+  options:
+  
   (some details hidden, use --verbose to show complete help)
 
   $ hg help diff
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 1 of 4 V3] recover: add a --[no-]verify flag

2019-04-17 Thread Pierre-Yves David
# HG changeset patch
# User Pierre-Yves David 
# Date 1555454220 -7200
#  Wed Apr 17 00:37:00 2019 +0200
# Node ID f233cb63bc077267d8571378350d9563cbabcf3d
# Parent  eebf78724d94649de84f921ff5bd39cbc0f48cb6
# EXP-Topic verify
# Available At https://bitbucket.org/octobus/mercurial-devel/
#  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 
f233cb63bc07
recover: add a --[no-]verify flag

For trivial cases, the cost of the verify run after `hg recover` is getting in
the way. In addition for very large repositories, the cost is simply too high
to be paid, making `hg recover` an unusable commands.

We introduce a --verify flag, set by default. If is automatically associated
with a --no-verify flag that one can use to skip the verify step.

We might consider changing the default behavior in the future. However this is
out of scope for this series.

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -4655,8 +4655,11 @@ def push(ui, repo, dest=None, **opts):
 
 return result
 
-@command('recover', [], helpcategory=command.CATEGORY_MAINTENANCE)
-def recover(ui, repo):
+@command('recover',
+[('','verify', True, "run `hg verify` after succesful recover"),
+],
+helpcategory=command.CATEGORY_MAINTENANCE)
+def recover(ui, repo, **opts):
 """roll back an interrupted transaction
 
 Recover from an interrupted commit or pull.
@@ -4667,8 +4670,15 @@ def recover(ui, repo):
 
 Returns 0 if successful, 1 if nothing to recover or verify fails.
 """
-if repo.recover():
-return hg.verify(repo)
+ret = repo.recover()
+if ret:
+if opts['verify']:
+return hg.verify(repo)
+else:
+msg = _("(verify step skipped, run  `hg verify` to check your "
+"repository content)\n")
+ui.warn(msg)
+return 0
 return 1
 
 @command('remove|rm',
diff --git a/tests/test-completion.t b/tests/test-completion.t
--- a/tests/test-completion.t
+++ b/tests/test-completion.t
@@ -332,7 +332,7 @@ Show all commands + options
   phase: public, draft, secret, force, rev
   pull: update, force, rev, bookmark, branch, ssh, remotecmd, insecure
   push: force, rev, bookmark, branch, new-branch, pushvars, publish, ssh, 
remotecmd, insecure
-  recover: 
+  recover: verify
   remove: after, force, subrepos, include, exclude, dry-run
   rename: after, force, include, exclude, dry-run
   resolve: all, list, mark, unmark, no-status, re-merge, tool, include, 
exclude, template
diff --git a/tests/test-journal-exists.t b/tests/test-journal-exists.t
--- a/tests/test-journal-exists.t
+++ b/tests/test-journal-exists.t
@@ -21,6 +21,33 @@
   checking files
   checked 1 changesets with 1 changes to 1 files
 
+recover, explicite verify
+
+  $ touch .hg/store/journal
+  $ hg ci -Am0
+  abort: abandoned transaction found!
+  (run 'hg recover' to clean up transaction)
+  [255]
+  $ hg recover --verify
+  rolling back interrupted transaction
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  checked 1 changesets with 1 changes to 1 files
+
+recover, no verify
+
+  $ touch .hg/store/journal
+  $ hg ci -Am0
+  abort: abandoned transaction found!
+  (run 'hg recover' to clean up transaction)
+  [255]
+  $ hg recover --no-verify
+  rolling back interrupted transaction
+  (verify step skipped, run  `hg verify` to check your repository content)
+
+
 Check that zero-size journals are correctly aborted:
 
 #if unix-permissions no-root
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 2 of 4 V3] verify: introduce a notion of "level"

2019-04-17 Thread Pierre-Yves David
# HG changeset patch
# User Pierre-Yves David 
# Date 1555456341 -7200
#  Wed Apr 17 01:12:21 2019 +0200
# Node ID 55bd98999c25b10e220477fd4cc446a7c9c1f8ca
# Parent  f233cb63bc077267d8571378350d9563cbabcf3d
# EXP-Topic verify
# Available At https://bitbucket.org/octobus/mercurial-devel/
#  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 
55bd98999c25
verify: introduce a notion of "level"

Some checks are slower than others, to help the user to run the checks he needs,
we are about to introduce new flag to select faster vs deeper runs. This put
the scaffolding in place to do this.

diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -1092,9 +1092,9 @@ def outgoing(ui, repo, dest, opts):
 recurse()
 return 0 # exit code is zero since we found outgoing changes
 
-def verify(repo):
+def verify(repo, level=None):
 """verify the consistency of a repository"""
-ret = verifymod.verify(repo)
+ret = verifymod.verify(repo, level=level)
 
 # Broken subrepo references in hidden csets don't seem worth worrying 
about,
 # since they can't be pushed/pulled, and --hidden can be used if they are a
diff --git a/mercurial/verify.py b/mercurial/verify.py
--- a/mercurial/verify.py
+++ b/mercurial/verify.py
@@ -22,9 +22,12 @@ from . import (
 util,
 )
 
-def verify(repo):
+VERIFY_DEFAULT = 0
+
+def verify(repo, level=None):
 with repo.lock():
-return verifier(repo).verify()
+v = verifier(repo, level)
+return v.verify()
 
 def _normpath(f):
 # under hg < 2.4, convert didn't sanitize paths properly, so a
@@ -34,10 +37,13 @@ def _normpath(f):
 return f
 
 class verifier(object):
-def __init__(self, repo):
+def __init__(self, repo, level=None):
 self.repo = repo.unfiltered()
 self.ui = repo.ui
 self.match = repo.narrowmatch()
+if level is None:
+level = VERIFY_DEFAULT
+self._level = level
 self.badrevs = set()
 self.errors = 0
 self.warnings = 0
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 4 of 4 V3] verify: also check full manifest validity during verify runs

2019-04-17 Thread Pierre-Yves David
# HG changeset patch
# User Pierre-Yves David 
# Date 1551881213 -3600
#  Wed Mar 06 15:06:53 2019 +0100
# Node ID 15d38aadce0e1a4cc526e9bbbc42a158c263df53
# Parent  9bec7491e9b4cabdfa4d264e5213b1f416ec2607
# EXP-Topic verify
# Available At https://bitbucket.org/octobus/mercurial-devel/
#  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 
15d38aadce0e
verify: also check full manifest validity during verify runs

Before this changes, `hg verify` only checked if a manifest revision existed and
referenced the proper files. However it never checked the manifest revision
content itself.

Mercurial is expecting manifest entries to be sorted and will crash otherwise.
Since `hg verify` did not attempted a full restoration of manifest entry, it
could ignore this kind of corruption.

This new check significantly increases the cost of a `hg verify` run. This
especially affects large repository not using `sparse-revlog`. For now, this is
hidden behind the `--full` experimental flag.

diff --git a/mercurial/verify.py b/mercurial/verify.py
--- a/mercurial/verify.py
+++ b/mercurial/verify.py
@@ -337,6 +337,16 @@ class verifier(object):
 filenodes.setdefault(fullpath, {}).setdefault(fn, lr)
 except Exception as inst:
 self._exc(lr, _("reading delta %s") % short(n), inst, label)
+if self._level >= VERIFY_FULL:
+try:
+# Various issues can affect manifest. So we read each full
+# text from storage. This triggers the checks from the core
+# code (eg: hash verification, filename are ordered, etc.)
+mfdelta = mfl.get(dir, n).read()
+except Exception as inst:
+self._exc(lr, _("reading full manifest %s") % short(n),
+  inst, label)
+
 if not dir:
 progress.complete()
 
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6218: narrow: send specs as bundle2 data instead of param (issue5952) (issue6019)

2019-04-17 Thread pulkit (Pulkit Goyal)
pulkit added a comment.


  In https://phab.mercurial-scm.org/D6218#91119, @martinvonz wrote:
  
  > In https://phab.mercurial-scm.org/D6218#91058, @indygreg wrote:
  >
  > > This patch is backwards incompatible over the wire protocol.
  > >
  > > The problem is a new client will blindly send part data to an old server 
expecting part parameters. The old server won't read the part data and it would 
be as if the includes and excludes were not sent.
  >
  >
  > It's an experimental feature and I suspect it's used only by Sandu 
(@idlsoft). Sandu, if we released this without the capability negotiation that 
Greg is talking about, you would need to make sure to upgrade the server before 
you upgrade your client(s). Are you okay with that? Is anyone aware of any 
other users of this feature? Greg, are you okay with making a breaking change 
(to an experimental feature) if the few existing users are okay with it?
  
  
  I agree with @martinvonz here. narrow extension is experimental right now, in 
4.9 we had a lot of breaking changes. The narrowspecs are only send back in 
case when ACL is enabled. If there are users who rely on existing behavior, 
they must have hit the bug just like @idlsoft  hit.
  
  I am not sure how we can keep sending narrowspecs back using bundle2 param 
and fix the issues which this patch is trying to.
  
  > 
  > 
  >> We need some kind of capability negotiation that allows the client to opt 
in to the newer behavior if the server advertises support for it.
  >> 
  >> Also, my personal preference is to create new bundle2 parts rather than 
change behavior of existing bundle2 parts. Doing things this way ensures that 
behavior for a named bundle2 part is constant over time. This keeps 
implementations simpler, as individual part handling can do one thing and one 
thing only.
  >> 
  >> Finally, the internals help docs should be updated to reflect changes to 
bundle2 part behavior.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6218

To: pulkit, durin42, martinvonz, #hg-reviewers
Cc: indygreg, idlsoft, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 2 of 2] setdiscovery: stop limiting the number of local head we initially send

2019-04-17 Thread Martin von Zweigbergk via Mercurial-devel
On Wed, Apr 17, 2019 at 3:36 AM Pierre-Yves David <
pierre-yves.da...@ens-lyon.org> wrote:

>
>
> On 4/17/19 5:59 AM, Martin von Zweigbergk wrote:
> >
> >
> > On Tue, Apr 16, 2019 at 11:41 AM Pierre-Yves David
> > mailto:pierre-yves.da...@ens-lyon.org>>
>
> > wrote:
> >
> > # HG changeset patch
> > # User Pierre-Yves David  > >
> > # Date 1555428398 -7200
> > #  Tue Apr 16 17:26:38 2019 +0200
> > # Node ID ffaa98def33a903f132ec4177d36823a741b6ef6
> > # Parent  017778a4463a8e6ecb4b17cacf46a3ab27bdb239
> > # EXP-Topic discovery-speedup
> > # Available At https://bitbucket.org/octobus/mercurial-devel/
> > #  hg pull
> > https://bitbucket.org/octobus/mercurial-devel/ -r ffaa98def33a
> > setdiscovery: stop limiting the number of local head we initially
> send
> >
> >
> > I think I tried something like this before. I still have a commit in my
> > repo. I don't remember why I didn't send it. Perhaps the issue was that
> > the heads are sent in HTTP headers and we need to limit the size of
> > those to work with restrictive proxies and servers?
>
> My intuition is that we are going to it that limit later anyway (eg: in
> the getbundle common parameters).
>

IIRC, we split up the HgArgs header when it gets too big. I don't know
about the getbundle parameters.


>
> What is our way forward here?


Perhaps capability-guarded support for putting it in the request body? We
already have support for that with experimental.httppostargs. I don't know
if that also replaces GET requests by POST requests (and I don't know if
the server accepts either method), so perhaps we'll need another capability
here. Augie?

This provide a large boost that I would
> rather have in 5.0 core instead of having to patch it all around. Should

we hide the behavior behind a config as a start?
>

I'd be fine with making the limits that are currently 100 and 200 both
configurable (as experimental options).


>
> Cheers,
>
> --
> Pierre-Yves David
>
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6218: narrow: send specs as bundle2 data instead of param (issue5952) (issue6019)

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment.


  In https://phab.mercurial-scm.org/D6218#91058, @indygreg wrote:
  
  > This patch is backwards incompatible over the wire protocol.
  >
  > The problem is a new client will blindly send part data to an old server 
expecting part parameters. The old server won't read the part data and it would 
be as if the includes and excludes were not sent.
  
  
  It's an experimental feature and I suspect it's used only by Sandu 
(@idlsoft). Sandu, if we released this without the capability negotiation that 
Greg is talking about, you would need to make sure to upgrade the server before 
you upgrade your client(s). Are you okay with that? Is anyone aware of any 
other users of this feature? Greg, are you okay with making a breaking change 
(to an experimental feature) if the few existing users are okay with it?
  
  > We need some kind of capability negotiation that allows the client to opt 
in to the newer behavior if the server advertises support for it.
  > 
  > Also, my personal preference is to create new bundle2 parts rather than 
change behavior of existing bundle2 parts. Doing things this way ensures that 
behavior for a named bundle2 part is constant over time. This keeps 
implementations simpler, as individual part handling can do one thing and one 
thing only.
  > 
  > Finally, the internals help docs should be updated to reflect changes to 
bundle2 part behavior.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6218

To: pulkit, durin42, martinvonz, #hg-reviewers
Cc: indygreg, idlsoft, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH V4] repoview: introduce a `experimental.extra-filter-revs` config

2019-04-17 Thread Pierre-Yves David
# HG changeset patch
# User Pierre-Yves David 
# Date 1554565579 -7200
#  Sat Apr 06 17:46:19 2019 +0200
# Node ID a6885b6d14025a68c1b65128050384f3849ff688
# Parent  eebf78724d94649de84f921ff5bd39cbc0f48cb6
# EXP-Topic repoview
# Available At https://bitbucket.org/octobus/mercurial-devel/
#  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 
a6885b6d1402
repoview: introduce a `experimental.extra-filter-revs` config

The option define revisions to additionally filter out of all repository "view".
The end goal is to provide and easy to way to serve multiple subset of the same
repository using multiple "shares".

The simplest use case of this feature is to have one view serving the public
changesets and one view also serving the draft. This is currently achievable
using the new `server.view` option introduced recently by Joerg Sonnenberger.
However, more advanced use cases need more advanced definitions. For example
some needs a view dedicated to some release branches, or view that hides
security fixes to be released. Joerg Sonnenberger and I discussed this topic at
the recent mini-sprint and the both of us have seen real life use cases for
this. (This series got written during the same mini-sprint).

The feature is fully functional, and use similar cache-fallback mechanism to
ensure decent performance. However,there remaining room to ensure each share
caches and hooks collaborate with each others. This will come at a later time
once users start to actually test this feature on real usecase.

diff --git a/mercurial/configitems.py b/mercurial/configitems.py
--- a/mercurial/configitems.py
+++ b/mercurial/configitems.py
@@ -529,6 +529,13 @@ coreconfigitem('experimental', 'evolutio
 coreconfigitem('experimental', 'evolution.track-operation',
 default=True,
 )
+# repo-level config to exclude a revset visibility
+#
+# The target use case is to use `share` to expose different subset of the same
+# repository, especially server side. See also `server.view`.
+coreconfigitem('experimental', 'extra-filter-revs',
+default=None,
+)
 coreconfigitem('experimental', 'maxdeltachainspan',
 default=-1,
 )
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1050,6 +1050,8 @@ class localrepository(object):
 # Signature to cached matcher instance.
 self._sparsematchercache = {}
 
+self._extrafilterid = repoview.extrafilter(ui)
+
 def _getvfsward(self, origfunc):
 """build a ward for self.vfs"""
 rref = weakref.ref(self)
@@ -1197,6 +1199,9 @@ class localrepository(object):
 
 In other word, there is always only one level of `repoview` 
"filtering".
 """
+if self._extrafilterid is not None and '%' not in name:
+name = name + '%'  + self._extrafilterid
+
 cls = repoview.newtype(self.unfiltered().__class__)
 return cls(self, name, visibilityexceptions)
 
diff --git a/mercurial/repoview.py b/mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -17,6 +17,10 @@ from . import (
 phases,
 pycompat,
 tags as tagsmod,
+util,
+)
+from .utils import (
+repoviewutil,
 )
 
 def hideablerevs(repo):
@@ -154,6 +158,35 @@ filtertable = {'visible': computehidden,
'immutable':  computemutable,
'base':  computeimpactable}
 
+_basefiltername = list(filtertable)
+
+def extrafilter(ui):
+"""initialize extra filter and return its id
+
+If extra filtering is configured, we make sure the associated filtered view
+are declared and return the associated id.
+"""
+frevs = ui.config('experimental', 'extra-filter-revs')
+if frevs is None:
+return None
+
+fid = pycompat.sysbytes(util.DIGESTS['sha1'](frevs).hexdigest())[:12]
+
+combine = lambda fname: fname + '%' + fid
+
+subsettable = repoviewutil.subsettable
+
+if combine('base') not in filtertable:
+for name in _basefiltername:
+def extrafilteredrevs(repo, *args, **kwargs):
+baserevs = filtertable[name](repo, *args, **kwargs)
+extrarevs = frozenset(repo.revs(frevs))
+return baserevs | extrarevs
+filtertable[combine(name)] = extrafilteredrevs
+if name in subsettable:
+subsettable[combine(name)] = combine(subsettable[name])
+return fid
+
 def filterrevs(repo, filtername, visibilityexceptions=None):
 """returns set of filtered revision for this filter name
 
diff --git a/mercurial/statichttprepo.py b/mercurial/statichttprepo.py
--- a/mercurial/statichttprepo.py
+++ b/mercurial/statichttprepo.py
@@ -155,6 +155,7 @@ class statichttprepository(localrepo.loc
 
 self.names = namespaces.namespaces()
 self.filtername = None
+self._extrafilterid = None
 
 try:
 requirements = set(self.vfs.read(b'requires').splitlines())
diff --git 

Re: [PATCH 4 of 4] verify: also check full manifest validity during verify runs

2019-04-17 Thread Martin von Zweigbergk via Mercurial-devel
On Wed, Apr 17, 2019, 06:52 Pierre-Yves David <
pierre-yves.da...@ens-lyon.org> wrote:

>
>
> On 4/17/19 3:49 PM, Martin von Zweigbergk wrote:
> >
> >
> > On Wed, Apr 17, 2019, 06:47 Pierre-Yves David
> > mailto:pierre-yves.da...@ens-lyon.org>>
>
> > wrote:
> >
> >
> >
> > On 4/17/19 3:06 PM, Martin von Zweigbergk wrote:
> >  >
> >  >
> >  > On Wed, Apr 17, 2019, 03:34 Pierre-Yves David
> >  >  > 
> >  > >>
> >  > wrote:
> >  >
> >  > On 4/17/19 4:59 AM, Martin von Zweigbergk wrote:
> >  >  >
> >  >  >
> >  >  > On Tue, Apr 16, 2019, 16:46 Pierre-Yves David
> >  >  >  > 
> >  >  > >
> >  >  > 
> >  >  >  >  >  > wrote:
> >  >  >
> >  >  > # HG changeset patch
> >  >  > # User Pierre-Yves David
> > mailto:pierre-yves.da...@octobus.net
> >
> >  >  > >
> >  >  >  > 
> >  >  >  >  >  > # Date 1551881213 -3600
> >  >  > #  Wed Mar 06 15:06:53 2019 +0100
> >  >  > # Node ID ed796867a06764cd78a57b2ed0249353f5809319
> >  >  > # Parent  9bec7491e9b4cabdfa4d264e5213b1f416ec2607
> >  >  > # EXP-Topic verify
> >  >  > # Available At
> > https://bitbucket.org/octobus/mercurial-devel/
> >  >  > #  hg pull
> >  >  > https://bitbucket.org/octobus/mercurial-devel/ -r
> ed796867a067
> >  >  > verify: also check full manifest validity during
> > verify runs
> >  >  >
> >  >  > Before this changes, `hg verify` only checked if a
> > manifest
> >  > revision
> >  >  > existed and
> >  >  > referenced the proper files. However it never checked
> the
> >  > manifest
> >  >  > revision
> >  >  > content itself.
> >  >  >
> >  >  > Mercurial is expecting manifest entries to be sorted
> > and will
> >  > crash
> >  >  > otherwise.
> >  >  > Since `hg verify` did not attempted a full restoration
> of
> >  > manifest
> >  >  > entry, it
> >  >  > could ignore this kind of corruption.
> >  >  >
> >  >  > This new check significantly increases the cost of a
> > `hg verify`
> >  >  > run. This
> >  >  > especially affects large repository not using
> >  > `sparse-revlog`. For
> >  >  > now, this is
> >  >  > hidden behind the `--full` experimental flag.
> >  >  >
> >  >  > diff --git a/mercurial/verify.py b/mercurial/verify.py
> >  >  > --- a/mercurial/verify.py
> >  >  > +++ b/mercurial/verify.py
> >  >  > @@ -337,6 +337,16 @@ class verifier(object):
> >  >  >
>  filenodes.setdefault(fullpath,
> >  >  > {}).setdefault(fn, lr)
> >  >  >   except Exception as inst:
> >  >  >   self._exc(lr, _("reading delta %s")
> > % short(n),
> >  >  > inst, label)
> >  >  > +if not dir and self._level >= VERIFY_FULL:
> >  >  >
> >  >  >
> >  >  > What does the "not dir" mean? I guess it's to do this
> > check only
> >  > for the
> >  >  > root directory when using tree manifests. Should we do it
> > for all
> >  >  > directories?
> >  >
> >  > That is used earlier in the same function to denote "the root
> >  > manifest".
> >  > I think check the root manifest will trigger checks of the
> > sub manifest
> >  > but I am not sure, I am not too familiar tree manifest.
> >  >
> >  >
> >  > I'm pretty sure it's about tree manifests. I asked just to make
> sure
> >  > since it surprised me that you used that as part of the condition
> > here.
> >
> > I know it is about tree manifest, I am reusing a pattern used by
> > earlier
> > code.
> >
> >  > Can we double
> >  > check/fix this as a follow up ?
> >  >
> >  >
> >  > It should be easy to check (just add a print statement and run
> > tests,
> >  > for example), so I don't see much 

Re: [PATCH] repoview: introduce a `experimental.extra-filter-revs` config

2019-04-17 Thread Pierre-Yves David



On 4/17/19 2:08 PM, Gregory Szorc wrote:




On Apr 17, 2019, at 13:34, Pierre-Yves David  
wrote:




On 4/17/19 1:22 PM, Gregory Szorc wrote:
diff --git a/tests/test-server-view.t b/tests/test-server-view.t
--- a/tests/test-server-view.t
+++ b/tests/test-server-view.t
@@ -34,5 +34,21 @@
date:Thu Jan 01 00:00:00 1970 +
summary: r0
+
+Check same result using `experimental.extra-filter-revs`
+
+  $ hg -R test --config experimental.extra-filter-revs='not
public()' serve -p $HGPORT1 -d --pid-file=hg2.pid -E errors.log
+  $ cat hg2.pid >> $DAEMON_PIDS
+  $ hg -R test2 incoming http://foo:xyzzy@localhost:$HGPORT1/
+  comparing with http://foo:***@localhost:$HGPORT1/
+  changeset:   0:1ea73414a91b
+  tag: tip
+  user:debugbuilddag
+  date:Thu Jan 01 00:00:00 1970 +
+  summary: r0
+


Could we also please get a test that the on-disk cache file(s) are crested as 
expected?

Regarding those on-disk cache files, are there any cache invalidation issues 
since revsets are dynamic? (I think we’re OK but I want to make sure we have 
thought things through.)


The cache validated themselves based on the skipped revision, so they 
will not use an invalid caches whichever it comes from (disk, subset, etc…).


--
Pierre-Yves David
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH] repoview: introduce a `experimental.extra-filter-revs` config

2019-04-17 Thread Pierre-Yves David



On 4/17/19 2:08 PM, Gregory Szorc wrote:




On Apr 17, 2019, at 13:34, Pierre-Yves David  
wrote:




On 4/17/19 1:22 PM, Gregory Szorc wrote:
On Tue, Apr 16, 2019 at 4:54 PM Pierre-Yves David mailto:pierre-yves.da...@ens-lyon.org>> wrote:
# HG changeset patch
# User Pierre-Yves David mailto:pierre-yves.da...@octobus.net>>
# Date 1554565579 -7200
#  Sat Apr 06 17:46:19 2019 +0200
# Node ID 86eac5d2d7a1386dca5970126506d07201058200
# Parent  eebf78724d94649de84f921ff5bd39cbc0f48cb6
# EXP-Topic repoview
# Available At https://bitbucket.org/octobus/mercurial-devel/
#  hg pull
https://bitbucket.org/octobus/mercurial-devel/ -r 86eac5d2d7a1
repoview: introduce a `experimental.extra-filter-revs` config
The option define revisions to additionally filter out of all
repository "view".
The end goal is to provide and easy to way to serve multiple subset
of the same
repository using multiple "shares".
The simplest use case of this feature is to have one view serving
the public
changesets and one view also serving the draft. This is currently
achievable
using the new `server.view` option introduced recently by Joerg
Sonnenberger.
However, more advanced use cases need more advanced definitions. For
example
some needs a view dedicated to some release branches, or view that hides
security fixes to be released. Joerg Sonnenberger and I discussed
this topic at
the recent mini-sprint and the both of us have seen real life use
cases for
this. (This series got written during the same mini-sprint).
The feature is fully functional, and use similar cache-fallback
mechanism to
ensure decent performance. However,there remaining room to ensure
each share
caches and hooks collaborate with each others. This will come at a
later time
once users start to actually test this feature on real usecase.
diff --git a/mercurial/configitems.py b/mercurial/configitems.py
--- a/mercurial/configitems.py
+++ b/mercurial/configitems.py
@@ -529,6 +529,13 @@ coreconfigitem('experimental', 'evolutio
  coreconfigitem('experimental', 'evolution.track-operation',
  default=True,
  )
+# repo-level config to exclude a revset visibility
+#
+# The target use case is to use `share` to expose different subset
of the same
+# repository, especially server side. See also `server.view`.
+coreconfigitem('experimental', 'extra-filter-revs',
+default=None,
+)
  coreconfigitem('experimental', 'maxdeltachainspan',
  default=-1,
  )
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1050,6 +1050,8 @@ class localrepository(object):
  # Signature to cached matcher instance.
  self._sparsematchercache = {}
+self._extrafilterid = repoview.extrafilter(ui)
+
  def _getvfsward(self, origfunc):
  """build a ward for self.vfs"""
  rref = weakref.ref(self)
@@ -1197,6 +1199,9 @@ class localrepository(object):
  In other word, there is always only one level of
`repoview` "filtering".
  """
+if self._extrafilterid is not None:
+name = name + '%'  + self._extrafilterid
+
  cls = repoview.newtype(self.unfiltered().__class__)
  return cls(self, name, visibilityexceptions)
diff --git a/mercurial/repoview.py b/mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -17,6 +17,10 @@ from . import (
  phases,
  pycompat,
  tags as tagsmod,
+util,
+)
+from .utils import (
+repoviewutil,
  )
  def hideablerevs(repo):
@@ -154,6 +158,35 @@ filtertable = {'visible': computehidden,
 'immutable':  computemutable,
 'base':  computeimpactable}
+_basefiltername = list(filtertable)
+
+def extrafilter(ui):
+"""initialize extra filter and return its id
+
+If extra filtering is configured, we make sure the associated
filtered view
+are declared and return the associated id.
+"""
+frevs = ui.config('experimental', 'extra-filter-revs')
+if frevs is None:
+return None
+
+fid = util.DIGESTS['sha512'](frevs).hexdigest()
Why are we computing a hash here? Why not store the raw query? Is it because 
the filter names can be persisted to disk in the cache and must therefore be 
valid filenames?


Since query can be arbitrarily long, complex with any char. It seems simple to 
keep the ID simple. Especially because we persist it on disk


Is % an allowed character on all filesystems? Maybe '-' would be safer?


% is a valid filename character on all system but RT-11. I think we are safe. I would 

Re: [PATCH 2 of 4] verify: introduce a notion of "level"

2019-04-17 Thread Pierre-Yves David



On 4/17/19 3:15 PM, Gregory Szorc wrote:




On Apr 17, 2019, at 01:38, Pierre-Yves David  
wrote:

# HG changeset patch
# User Pierre-Yves David 
# Date 1555456341 -7200
#  Wed Apr 17 01:12:21 2019 +0200
# Node ID 55bd98999c25b10e220477fd4cc446a7c9c1f8ca
# Parent  f233cb63bc077267d8571378350d9563cbabcf3d
# EXP-Topic verify
# Available At https://bitbucket.org/octobus/mercurial-devel/
#  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 
55bd98999c25
verify: introduce a notion of "level"

Some checks are slower than others, to help the user to run the checks he needs,
we are about to introduce new flag to select faster vs deeper runs. This put
the scaffolding in place to do this.


I’m in favor of customizing verify behavior: it is an overdue feature IMO.

Experience tells me that shoehorning things into a numeric level will be 
fragile and won’t scale well. I’m wondering if we should introduce individual 
“feature flags” / arguments to control what is verified. That will make the 
code a bit cleaner and easier to separate IMO. If we want to map a number to a 
set of verify options, we can do that too.

This idea is scope bloat. But something tells me we’ll regret the limitations 
of numeric levels in the future. I’d rather pass in a set of things to verify. 
This is also more extensible.


I agree with you on the general principle (being able to select what we 
check for. I also agree that it is outside the scope of this small 
series. (I documented the checks earlier this cycle, so we will have 
something to start from).


I am not sure if you are requesting changes here or not. The internal 
implementation can be changed later and the flag is experimental, so 
everything in this series can be adjusted later.


Do you have specific changes in mind to get this series in ?






diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -1092,9 +1092,9 @@ def outgoing(ui, repo, dest, opts):
 recurse()
 return 0 # exit code is zero since we found outgoing changes

-def verify(repo):
+def verify(repo, level=None):
 """verify the consistency of a repository"""
-ret = verifymod.verify(repo)
+ret = verifymod.verify(repo, level=level)

 # Broken subrepo references in hidden csets don't seem worth worrying 
about,
 # since they can't be pushed/pulled, and --hidden can be used if they are a
diff --git a/mercurial/verify.py b/mercurial/verify.py
--- a/mercurial/verify.py
+++ b/mercurial/verify.py
@@ -22,9 +22,12 @@ from . import (
 util,
)

-def verify(repo):
+VERIFY_DEFAULT = 0
+
+def verify(repo, level=None):
 with repo.lock():
-return verifier(repo).verify()
+v = verifier(repo, level)
+return v.verify()

def _normpath(f):
 # under hg < 2.4, convert didn't sanitize paths properly, so a
@@ -34,10 +37,13 @@ def _normpath(f):
 return f

class verifier(object):
-def __init__(self, repo):
+def __init__(self, repo, level=None):
 self.repo = repo.unfiltered()
 self.ui = repo.ui
 self.match = repo.narrowmatch()
+if level is None:
+level = VERIFY_DEFAULT
+self._level = level
 self.badrevs = set()
 self.errors = 0
 self.warnings = 0
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


--
Pierre-Yves David
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 4 of 4] verify: also check full manifest validity during verify runs

2019-04-17 Thread Pierre-Yves David



On 4/17/19 3:49 PM, Martin von Zweigbergk wrote:



On Wed, Apr 17, 2019, 06:47 Pierre-Yves David 
mailto:pierre-yves.da...@ens-lyon.org>> 
wrote:




On 4/17/19 3:06 PM, Martin von Zweigbergk wrote:
 >
 >
 > On Wed, Apr 17, 2019, 03:34 Pierre-Yves David
 > mailto:pierre-yves.da...@ens-lyon.org>
>>
 > wrote:
 >
 >     On 4/17/19 4:59 AM, Martin von Zweigbergk wrote:
 >      >
 >      >
 >      > On Tue, Apr 16, 2019, 16:46 Pierre-Yves David
 >      > mailto:pierre-yves.da...@ens-lyon.org>
 >     >
 >     
 >           > wrote:
 >      >
 >      >     # HG changeset patch
 >      >     # User Pierre-Yves David
mailto:pierre-yves.da...@octobus.net>
 >     >
 >      >     
 >           >     # Date 1551881213 -3600
 >      >     #      Wed Mar 06 15:06:53 2019 +0100
 >      >     # Node ID ed796867a06764cd78a57b2ed0249353f5809319
 >      >     # Parent  9bec7491e9b4cabdfa4d264e5213b1f416ec2607
 >      >     # EXP-Topic verify
 >      >     # Available At
https://bitbucket.org/octobus/mercurial-devel/
 >      >     #              hg pull
 >      > https://bitbucket.org/octobus/mercurial-devel/ -r ed796867a067
 >      >     verify: also check full manifest validity during
verify runs
 >      >
 >      >     Before this changes, `hg verify` only checked if a
manifest
 >     revision
 >      >     existed and
 >      >     referenced the proper files. However it never checked the
 >     manifest
 >      >     revision
 >      >     content itself.
 >      >
 >      >     Mercurial is expecting manifest entries to be sorted
and will
 >     crash
 >      >     otherwise.
 >      >     Since `hg verify` did not attempted a full restoration of
 >     manifest
 >      >     entry, it
 >      >     could ignore this kind of corruption.
 >      >
 >      >     This new check significantly increases the cost of a
`hg verify`
 >      >     run. This
 >      >     especially affects large repository not using
 >     `sparse-revlog`. For
 >      >     now, this is
 >      >     hidden behind the `--full` experimental flag.
 >      >
 >      >     diff --git a/mercurial/verify.py b/mercurial/verify.py
 >      >     --- a/mercurial/verify.py
 >      >     +++ b/mercurial/verify.py
 >      >     @@ -337,6 +337,16 @@ class verifier(object):
 >      >                               filenodes.setdefault(fullpath,
 >      >     {}).setdefault(fn, lr)
 >      >                   except Exception as inst:
 >      >                       self._exc(lr, _("reading delta %s")
% short(n),
 >      >     inst, label)
 >      >     +            if not dir and self._level >= VERIFY_FULL:
 >      >
 >      >
 >      > What does the "not dir" mean? I guess it's to do this
check only
 >     for the
 >      > root directory when using tree manifests. Should we do it
for all
 >      > directories?
 >
 >     That is used earlier in the same function to denote "the root
 >     manifest".
 >     I think check the root manifest will trigger checks of the
sub manifest
 >     but I am not sure, I am not too familiar tree manifest.
 >
 >
 > I'm pretty sure it's about tree manifests. I asked just to make sure
 > since it surprised me that you used that as part of the condition
here.

I know it is about tree manifest, I am reusing a pattern used by
earlier
code.

 >     Can we double
 >     check/fix this as a follow up ?
 >
 >
 > It should be easy to check (just add a print statement and run
tests,
 > for example), so I don't see much reason to fix such a simple
thing in a
 > follow-up.

The question here is "Does reading the top level manifest will
validated
the content of the sub manifest too". I don't know how reliably to
check
it in a reasonable amount of time. I am not exposed to any tree
manifest
user myself.


Ah, no, it won't read sub manifests. You're simply skipping sub 
manifests by including the "not dir" check.


so should we just drop the "not dir" ?

--
Pierre-Yves David
___

Re: [PATCH 4 of 4] verify: also check full manifest validity during verify runs

2019-04-17 Thread Martin von Zweigbergk via Mercurial-devel
On Wed, Apr 17, 2019, 06:47 Pierre-Yves David <
pierre-yves.da...@ens-lyon.org> wrote:

>
>
> On 4/17/19 3:06 PM, Martin von Zweigbergk wrote:
> >
> >
> > On Wed, Apr 17, 2019, 03:34 Pierre-Yves David
> > mailto:pierre-yves.da...@ens-lyon.org>>
>
> > wrote:
> >
> > On 4/17/19 4:59 AM, Martin von Zweigbergk wrote:
> >  >
> >  >
> >  > On Tue, Apr 16, 2019, 16:46 Pierre-Yves David
> >  >  > 
> >  > >>
> >  > wrote:
> >  >
> >  > # HG changeset patch
> >  > # User Pierre-Yves David  > 
> >  >  > >>
> >  > # Date 1551881213 -3600
> >  > #  Wed Mar 06 15:06:53 2019 +0100
> >  > # Node ID ed796867a06764cd78a57b2ed0249353f5809319
> >  > # Parent  9bec7491e9b4cabdfa4d264e5213b1f416ec2607
> >  > # EXP-Topic verify
> >  > # Available At https://bitbucket.org/octobus/mercurial-devel/
> >  > #  hg pull
> >  > https://bitbucket.org/octobus/mercurial-devel/ -r ed796867a067
> >  > verify: also check full manifest validity during verify runs
> >  >
> >  > Before this changes, `hg verify` only checked if a manifest
> > revision
> >  > existed and
> >  > referenced the proper files. However it never checked the
> > manifest
> >  > revision
> >  > content itself.
> >  >
> >  > Mercurial is expecting manifest entries to be sorted and will
> > crash
> >  > otherwise.
> >  > Since `hg verify` did not attempted a full restoration of
> > manifest
> >  > entry, it
> >  > could ignore this kind of corruption.
> >  >
> >  > This new check significantly increases the cost of a `hg
> verify`
> >  > run. This
> >  > especially affects large repository not using
> > `sparse-revlog`. For
> >  > now, this is
> >  > hidden behind the `--full` experimental flag.
> >  >
> >  > diff --git a/mercurial/verify.py b/mercurial/verify.py
> >  > --- a/mercurial/verify.py
> >  > +++ b/mercurial/verify.py
> >  > @@ -337,6 +337,16 @@ class verifier(object):
> >  >   filenodes.setdefault(fullpath,
> >  > {}).setdefault(fn, lr)
> >  >   except Exception as inst:
> >  >   self._exc(lr, _("reading delta %s") %
> short(n),
> >  > inst, label)
> >  > +if not dir and self._level >= VERIFY_FULL:
> >  >
> >  >
> >  > What does the "not dir" mean? I guess it's to do this check only
> > for the
> >  > root directory when using tree manifests. Should we do it for all
> >  > directories?
> >
> > That is used earlier in the same function to denote "the root
> > manifest".
> > I think check the root manifest will trigger checks of the sub
> manifest
> > but I am not sure, I am not too familiar tree manifest.
> >
> >
> > I'm pretty sure it's about tree manifests. I asked just to make sure
> > since it surprised me that you used that as part of the condition here.
>
> I know it is about tree manifest, I am reusing a pattern used by earlier
> code.
>
> > Can we double
> > check/fix this as a follow up ?
> >
> >
> > It should be easy to check (just add a print statement and run tests,
> > for example), so I don't see much reason to fix such a simple thing in a
> > follow-up.
>
> The question here is "Does reading the top level manifest will validated
> the content of the sub manifest too". I don't know how reliably to check
> it in a reasonable amount of time. I am not exposed to any tree manifest
> user myself.
>

Ah, no, it won't read sub manifests. You're simply skipping sub manifests
by including the "not dir" check.


> > Btw, it would be nice to have tests too, but I understand that that's
> > harder to do. Thoughts on how it could be done? Prepared bundle or some
> > python code for writing out a bad manifest entry should work, I guess.
>
> The corruption I encounter requires to write buggy manifest by hand. I
> agree if would be nice to cover that in the test. However, that requires
> significantly more time and exceed my initial "let's just share that
> code upstream" intend.
>
> Cheers,
>
> --
> Pierre-Yves David
>
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 2 of 4 V2] verify: introduce a notion of "level"

2019-04-17 Thread Martin von Zweigbergk via Mercurial-devel
On Wed, Apr 17, 2019, 06:27 Pierre-Yves David <
pierre-yves.da...@ens-lyon.org> wrote:

>
>
> On 4/17/19 3:18 PM, Martin von Zweigbergk wrote:
> >
> >
> > On Wed, Apr 17, 2019, 03:49 Pierre-Yves David
> > mailto:pierre-yves.da...@ens-lyon.org>>
>
> > wrote:
> >
> > # HG changeset patch
> > # User Pierre-Yves David  > >
> > # Date 1555456341 -7200
> > #  Wed Apr 17 01:12:21 2019 +0200
> > # Node ID 55bd98999c25b10e220477fd4cc446a7c9c1f8ca
> > # Parent  f233cb63bc077267d8571378350d9563cbabcf3d
> > # EXP-Topic verify
> > # Available At https://bitbucket.org/octobus/mercurial-devel/
> > #  hg pull
> > https://bitbucket.org/octobus/mercurial-devel/ -r 55bd98999c25
> > verify: introduce a notion of "level"
> >
> >
> > I feel like this is unnecessarily complicated. It feels like just
> > passing a boolean "full" would be enough. If one level has been enough
> > for over ten years, it seems likely that two levels will be enough for
> > many years ahead. Or do you plan to add more levels?
>
> I am planning to pass a "quick" mode that only check for stuff like
> revlog size.


> Since the python code is implementation details and the command line
> flag is experimental we have a lot of flexibility here.
>
> Overall, the spirit of this series is only "I spent some time to
> diagnose a local issue, I would rather upstream that work so that the
> next person don't have to do it again", I am not in a long quest to
> improve `hg verify` and I don't plan to spend too much time on it in the
> near future.
>
> note: patch 1 is fairly independent from the level and manifest question
> and "fix" hg recover for a large set of users. Please consider taking
> that one while we discuss the rest.
>

Thanks, will do. I'll use that option myself (I currently ^C the verify
step :))


>
> --
> Pierre-Yves David
>
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 2 of 3 V2] repoview: introduce a `experimental.extra-filter-revs` config

2019-04-17 Thread Pierre-Yves David



On 4/17/19 3:44 PM, Martin von Zweigbergk wrote:



On Wed, Apr 17, 2019, 06:42 Martin von Zweigbergk > wrote:




On Tue, Apr 16, 2019, 11:52 Pierre-Yves David
mailto:pierre-yves.da...@ens-lyon.org>> wrote:

# HG changeset patch
# User Pierre-Yves David mailto:pierre-yves.da...@octobus.net>>
# Date 1554565579 -7200
#      Sat Apr 06 17:46:19 2019 +0200
# Node ID 898753ab5830bed2a7e16639a746376fa447577f
# Parent  56e2557a9401a3b3c60956b86860c84fb2e1330a
# EXP-Topic repoview
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull
https://bitbucket.org/octobus/mercurial-devel/ -r 898753ab5830
repoview: introduce a `experimental.extra-filter-revs` config

The option define revisions to additionally filter out of all
repository "view".
The end goal is to provide and easy to way to serve multiple
subset of the same
repository using multiple "shares".

The simplest use case of this feature is to have one view
serving the public
changesets and one view also serving the draft. This is
currently achievable
using the new `server.view` option introduced recently by Joerg
Sonnenberger.


Does that mean your mechanism can replace server.view? Do you plan
to remove that feature? I haven't checked, but it would be nice to
mark it experimental in 5.0 if it's not too late if we won't need it
after this feature is done.


... and I just saw that your commit that does just that went public. Thanks!



You are welcome.

--
Pierre-Yves David
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 4 of 4] verify: also check full manifest validity during verify runs

2019-04-17 Thread Pierre-Yves David



On 4/17/19 3:06 PM, Martin von Zweigbergk wrote:



On Wed, Apr 17, 2019, 03:34 Pierre-Yves David 
mailto:pierre-yves.da...@ens-lyon.org>> 
wrote:


On 4/17/19 4:59 AM, Martin von Zweigbergk wrote:
 >
 >
 > On Tue, Apr 16, 2019, 16:46 Pierre-Yves David
 > mailto:pierre-yves.da...@ens-lyon.org>
>>
 > wrote:
 >
 >     # HG changeset patch
 >     # User Pierre-Yves David mailto:pierre-yves.da...@octobus.net>
 >     >>
 >     # Date 1551881213 -3600
 >     #      Wed Mar 06 15:06:53 2019 +0100
 >     # Node ID ed796867a06764cd78a57b2ed0249353f5809319
 >     # Parent  9bec7491e9b4cabdfa4d264e5213b1f416ec2607
 >     # EXP-Topic verify
 >     # Available At https://bitbucket.org/octobus/mercurial-devel/
 >     #              hg pull
 > https://bitbucket.org/octobus/mercurial-devel/ -r ed796867a067
 >     verify: also check full manifest validity during verify runs
 >
 >     Before this changes, `hg verify` only checked if a manifest
revision
 >     existed and
 >     referenced the proper files. However it never checked the
manifest
 >     revision
 >     content itself.
 >
 >     Mercurial is expecting manifest entries to be sorted and will
crash
 >     otherwise.
 >     Since `hg verify` did not attempted a full restoration of
manifest
 >     entry, it
 >     could ignore this kind of corruption.
 >
 >     This new check significantly increases the cost of a `hg verify`
 >     run. This
 >     especially affects large repository not using
`sparse-revlog`. For
 >     now, this is
 >     hidden behind the `--full` experimental flag.
 >
 >     diff --git a/mercurial/verify.py b/mercurial/verify.py
 >     --- a/mercurial/verify.py
 >     +++ b/mercurial/verify.py
 >     @@ -337,6 +337,16 @@ class verifier(object):
 >                               filenodes.setdefault(fullpath,
 >     {}).setdefault(fn, lr)
 >                   except Exception as inst:
 >                       self._exc(lr, _("reading delta %s") % short(n),
 >     inst, label)
 >     +            if not dir and self._level >= VERIFY_FULL:
 >
 >
 > What does the "not dir" mean? I guess it's to do this check only
for the
 > root directory when using tree manifests. Should we do it for all
 > directories?

That is used earlier in the same function to denote "the root
manifest".
I think check the root manifest will trigger checks of the sub manifest
but I am not sure, I am not too familiar tree manifest.


I'm pretty sure it's about tree manifests. I asked just to make sure 
since it surprised me that you used that as part of the condition here.


I know it is about tree manifest, I am reusing a pattern used by earlier 
code.



Can we double
check/fix this as a follow up ?


It should be easy to check (just add a print statement and run tests, 
for example), so I don't see much reason to fix such a simple thing in a 
follow-up.


The question here is "Does reading the top level manifest will validated 
the content of the sub manifest too". I don't know how reliably to check 
it in a reasonable amount of time. I am not exposed to any tree manifest 
user myself.


Btw, it would be nice to have tests too, but I understand that that's 
harder to do. Thoughts on how it could be done? Prepared bundle or some 
python code for writing out a bad manifest entry should work, I guess.


The corruption I encounter requires to write buggy manifest by hand. I 
agree if would be nice to cover that in the test. However, that requires 
significantly more time and exceed my initial "let's just share that 
code upstream" intend.


Cheers,

--
Pierre-Yves David
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 2 of 3 V2] repoview: introduce a `experimental.extra-filter-revs` config

2019-04-17 Thread Martin von Zweigbergk via Mercurial-devel
On Wed, Apr 17, 2019, 06:42 Martin von Zweigbergk 
wrote:

>
>
> On Tue, Apr 16, 2019, 11:52 Pierre-Yves David <
> pierre-yves.da...@ens-lyon.org> wrote:
>
>> # HG changeset patch
>> # User Pierre-Yves David 
>> # Date 1554565579 -7200
>> #  Sat Apr 06 17:46:19 2019 +0200
>> # Node ID 898753ab5830bed2a7e16639a746376fa447577f
>> # Parent  56e2557a9401a3b3c60956b86860c84fb2e1330a
>> # EXP-Topic repoview
>> # Available At https://bitbucket.org/octobus/mercurial-devel/
>> #  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r
>> 898753ab5830
>> repoview: introduce a `experimental.extra-filter-revs` config
>>
>> The option define revisions to additionally filter out of all repository
>> "view".
>> The end goal is to provide and easy to way to serve multiple subset of
>> the same
>> repository using multiple "shares".
>>
>> The simplest use case of this feature is to have one view serving the
>> public
>> changesets and one view also serving the draft. This is currently
>> achievable
>> using the new `server.view` option introduced recently by Joerg
>> Sonnenberger.
>>
>
> Does that mean your mechanism can replace server.view? Do you plan to
> remove that feature? I haven't checked, but it would be nice to mark it
> experimental in 5.0 if it's not too late if we won't need it after this
> feature is done.
>

... and I just saw that your commit that does just that went public. Thanks!

>
>
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 2 of 3 V2] repoview: introduce a `experimental.extra-filter-revs` config

2019-04-17 Thread Martin von Zweigbergk via Mercurial-devel
On Tue, Apr 16, 2019, 11:52 Pierre-Yves David <
pierre-yves.da...@ens-lyon.org> wrote:

> # HG changeset patch
> # User Pierre-Yves David 
> # Date 1554565579 -7200
> #  Sat Apr 06 17:46:19 2019 +0200
> # Node ID 898753ab5830bed2a7e16639a746376fa447577f
> # Parent  56e2557a9401a3b3c60956b86860c84fb2e1330a
> # EXP-Topic repoview
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r
> 898753ab5830
> repoview: introduce a `experimental.extra-filter-revs` config
>
> The option define revisions to additionally filter out of all repository
> "view".
> The end goal is to provide and easy to way to serve multiple subset of the
> same
> repository using multiple "shares".
>
> The simplest use case of this feature is to have one view serving the
> public
> changesets and one view also serving the draft. This is currently
> achievable
> using the new `server.view` option introduced recently by Joerg
> Sonnenberger.
>

Does that mean your mechanism can replace server.view? Do you plan to
remove that feature? I haven't checked, but it would be nice to mark it
experimental in 5.0 if it's not too late if we won't need it after this
feature is done.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 2 of 4] verify: introduce a notion of "level"

2019-04-17 Thread Martin von Zweigbergk via Mercurial-devel
Heh, that's very much related to my comment on the V2 of this patch.

Pierre-Yves, have you considered sending patches via Phabricator? That
keeps comments on various versions of a patch together in one place.

On Wed, Apr 17, 2019, 06:18 Gregory Szorc  wrote:

>
>
> > On Apr 17, 2019, at 01:38, Pierre-Yves David <
> pierre-yves.da...@ens-lyon.org> wrote:
> >
> > # HG changeset patch
> > # User Pierre-Yves David 
> > # Date 1555456341 -7200
> > #  Wed Apr 17 01:12:21 2019 +0200
> > # Node ID 55bd98999c25b10e220477fd4cc446a7c9c1f8ca
> > # Parent  f233cb63bc077267d8571378350d9563cbabcf3d
> > # EXP-Topic verify
> > # Available At https://bitbucket.org/octobus/mercurial-devel/
> > #  hg pull https://bitbucket.org/octobus/mercurial-devel/
> -r 55bd98999c25
> > verify: introduce a notion of "level"
> >
> > Some checks are slower than others, to help the user to run the checks
> he needs,
> > we are about to introduce new flag to select faster vs deeper runs. This
> put
> > the scaffolding in place to do this.
>
> I’m in favor of customizing verify behavior: it is an overdue feature IMO.
>
> Experience tells me that shoehorning things into a numeric level will be
> fragile and won’t scale well. I’m wondering if we should introduce
> individual “feature flags” / arguments to control what is verified. That
> will make the code a bit cleaner and easier to separate IMO. If we want to
> map a number to a set of verify options, we can do that too.
>
> This idea is scope bloat. But something tells me we’ll regret the
> limitations of numeric levels in the future. I’d rather pass in a set of
> things to verify. This is also more extensible.
>
> >
> > diff --git a/mercurial/hg.py b/mercurial/hg.py
> > --- a/mercurial/hg.py
> > +++ b/mercurial/hg.py
> > @@ -1092,9 +1092,9 @@ def outgoing(ui, repo, dest, opts):
> > recurse()
> > return 0 # exit code is zero since we found outgoing changes
> >
> > -def verify(repo):
> > +def verify(repo, level=None):
> > """verify the consistency of a repository"""
> > -ret = verifymod.verify(repo)
> > +ret = verifymod.verify(repo, level=level)
> >
> > # Broken subrepo references in hidden csets don't seem worth
> worrying about,
> > # since they can't be pushed/pulled, and --hidden can be used if
> they are a
> > diff --git a/mercurial/verify.py b/mercurial/verify.py
> > --- a/mercurial/verify.py
> > +++ b/mercurial/verify.py
> > @@ -22,9 +22,12 @@ from . import (
> > util,
> > )
> >
> > -def verify(repo):
> > +VERIFY_DEFAULT = 0
> > +
> > +def verify(repo, level=None):
> > with repo.lock():
> > -return verifier(repo).verify()
> > +v = verifier(repo, level)
> > +return v.verify()
> >
> > def _normpath(f):
> > # under hg < 2.4, convert didn't sanitize paths properly, so a
> > @@ -34,10 +37,13 @@ def _normpath(f):
> > return f
> >
> > class verifier(object):
> > -def __init__(self, repo):
> > +def __init__(self, repo, level=None):
> > self.repo = repo.unfiltered()
> > self.ui = repo.ui
> > self.match = repo.narrowmatch()
> > +if level is None:
> > +level = VERIFY_DEFAULT
> > +self._level = level
> > self.badrevs = set()
> > self.errors = 0
> > self.warnings = 0
> > ___
> > Mercurial-devel mailing list
> > Mercurial-devel@mercurial-scm.org
> > https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
> ___
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6259: [POC] revset: on-disk cache for children queries

2019-04-17 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment.


  Perhaps we'd want this to not be specifically for revsets? We could also 
write to it when we write to the changelog to keep it up to date.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6259

To: joerg.sonnenberger, #hg-reviewers
Cc: martinvonz, indygreg, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 2 of 4 V2] verify: introduce a notion of "level"

2019-04-17 Thread Pierre-Yves David



On 4/17/19 3:18 PM, Martin von Zweigbergk wrote:



On Wed, Apr 17, 2019, 03:49 Pierre-Yves David 
mailto:pierre-yves.da...@ens-lyon.org>> 
wrote:


# HG changeset patch
# User Pierre-Yves David mailto:pierre-yves.da...@octobus.net>>
# Date 1555456341 -7200
#      Wed Apr 17 01:12:21 2019 +0200
# Node ID 55bd98999c25b10e220477fd4cc446a7c9c1f8ca
# Parent  f233cb63bc077267d8571378350d9563cbabcf3d
# EXP-Topic verify
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull
https://bitbucket.org/octobus/mercurial-devel/ -r 55bd98999c25
verify: introduce a notion of "level"


I feel like this is unnecessarily complicated. It feels like just 
passing a boolean "full" would be enough. If one level has been enough 
for over ten years, it seems likely that two levels will be enough for 
many years ahead. Or do you plan to add more levels?


I am planning to pass a "quick" mode that only check for stuff like 
revlog size.


Since the python code is implementation details and the command line 
flag is experimental we have a lot of flexibility here.


Overall, the spirit of this series is only "I spent some time to 
diagnose a local issue, I would rather upstream that work so that the 
next person don't have to do it again", I am not in a long quest to 
improve `hg verify` and I don't plan to spend too much time on it in the 
near future.


note: patch 1 is fairly independent from the level and manifest question 
and "fix" hg recover for a large set of users. Please consider taking 
that one while we discuss the rest.



--
Pierre-Yves David
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 2 of 4 V2] verify: introduce a notion of "level"

2019-04-17 Thread Martin von Zweigbergk via Mercurial-devel
On Wed, Apr 17, 2019, 03:49 Pierre-Yves David <
pierre-yves.da...@ens-lyon.org> wrote:

> # HG changeset patch
> # User Pierre-Yves David 
> # Date 1555456341 -7200
> #  Wed Apr 17 01:12:21 2019 +0200
> # Node ID 55bd98999c25b10e220477fd4cc446a7c9c1f8ca
> # Parent  f233cb63bc077267d8571378350d9563cbabcf3d
> # EXP-Topic verify
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r
> 55bd98999c25
> verify: introduce a notion of "level"


I feel like this is unnecessarily complicated. It feels like just passing a
boolean "full" would be enough. If one level has been enough for over ten
years, it seems likely that two levels will be enough for many years ahead.
Or do you plan to add more levels?
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 2 of 4] verify: introduce a notion of "level"

2019-04-17 Thread Gregory Szorc


> On Apr 17, 2019, at 01:38, Pierre-Yves David  
> wrote:
> 
> # HG changeset patch
> # User Pierre-Yves David 
> # Date 1555456341 -7200
> #  Wed Apr 17 01:12:21 2019 +0200
> # Node ID 55bd98999c25b10e220477fd4cc446a7c9c1f8ca
> # Parent  f233cb63bc077267d8571378350d9563cbabcf3d
> # EXP-Topic verify
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 
> 55bd98999c25
> verify: introduce a notion of "level"
> 
> Some checks are slower than others, to help the user to run the checks he 
> needs,
> we are about to introduce new flag to select faster vs deeper runs. This put
> the scaffolding in place to do this.

I’m in favor of customizing verify behavior: it is an overdue feature IMO.

Experience tells me that shoehorning things into a numeric level will be 
fragile and won’t scale well. I’m wondering if we should introduce individual 
“feature flags” / arguments to control what is verified. That will make the 
code a bit cleaner and easier to separate IMO. If we want to map a number to a 
set of verify options, we can do that too.

This idea is scope bloat. But something tells me we’ll regret the limitations 
of numeric levels in the future. I’d rather pass in a set of things to verify. 
This is also more extensible.

> 
> diff --git a/mercurial/hg.py b/mercurial/hg.py
> --- a/mercurial/hg.py
> +++ b/mercurial/hg.py
> @@ -1092,9 +1092,9 @@ def outgoing(ui, repo, dest, opts):
> recurse()
> return 0 # exit code is zero since we found outgoing changes
> 
> -def verify(repo):
> +def verify(repo, level=None):
> """verify the consistency of a repository"""
> -ret = verifymod.verify(repo)
> +ret = verifymod.verify(repo, level=level)
> 
> # Broken subrepo references in hidden csets don't seem worth worrying 
> about,
> # since they can't be pushed/pulled, and --hidden can be used if they are 
> a
> diff --git a/mercurial/verify.py b/mercurial/verify.py
> --- a/mercurial/verify.py
> +++ b/mercurial/verify.py
> @@ -22,9 +22,12 @@ from . import (
> util,
> )
> 
> -def verify(repo):
> +VERIFY_DEFAULT = 0
> +
> +def verify(repo, level=None):
> with repo.lock():
> -return verifier(repo).verify()
> +v = verifier(repo, level)
> +return v.verify()
> 
> def _normpath(f):
> # under hg < 2.4, convert didn't sanitize paths properly, so a
> @@ -34,10 +37,13 @@ def _normpath(f):
> return f
> 
> class verifier(object):
> -def __init__(self, repo):
> +def __init__(self, repo, level=None):
> self.repo = repo.unfiltered()
> self.ui = repo.ui
> self.match = repo.narrowmatch()
> +if level is None:
> +level = VERIFY_DEFAULT
> +self._level = level
> self.badrevs = set()
> self.errors = 0
> self.warnings = 0
> ___
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 4 of 4] verify: also check full manifest validity during verify runs

2019-04-17 Thread Martin von Zweigbergk via Mercurial-devel
On Wed, Apr 17, 2019, 03:34 Pierre-Yves David <
pierre-yves.da...@ens-lyon.org> wrote:

>
>
> On 4/17/19 4:59 AM, Martin von Zweigbergk wrote:
> >
> >
> > On Tue, Apr 16, 2019, 16:46 Pierre-Yves David
> > mailto:pierre-yves.da...@ens-lyon.org>>
>
> > wrote:
> >
> > # HG changeset patch
> > # User Pierre-Yves David  > >
> > # Date 1551881213 -3600
> > #  Wed Mar 06 15:06:53 2019 +0100
> > # Node ID ed796867a06764cd78a57b2ed0249353f5809319
> > # Parent  9bec7491e9b4cabdfa4d264e5213b1f416ec2607
> > # EXP-Topic verify
> > # Available At https://bitbucket.org/octobus/mercurial-devel/
> > #  hg pull
> > https://bitbucket.org/octobus/mercurial-devel/ -r ed796867a067
> > verify: also check full manifest validity during verify runs
> >
> > Before this changes, `hg verify` only checked if a manifest revision
> > existed and
> > referenced the proper files. However it never checked the manifest
> > revision
> > content itself.
> >
> > Mercurial is expecting manifest entries to be sorted and will crash
> > otherwise.
> > Since `hg verify` did not attempted a full restoration of manifest
> > entry, it
> > could ignore this kind of corruption.
> >
> > This new check significantly increases the cost of a `hg verify`
> > run. This
> > especially affects large repository not using `sparse-revlog`. For
> > now, this is
> > hidden behind the `--full` experimental flag.
> >
> > diff --git a/mercurial/verify.py b/mercurial/verify.py
> > --- a/mercurial/verify.py
> > +++ b/mercurial/verify.py
> > @@ -337,6 +337,16 @@ class verifier(object):
> >   filenodes.setdefault(fullpath,
> > {}).setdefault(fn, lr)
> >   except Exception as inst:
> >   self._exc(lr, _("reading delta %s") % short(n),
> > inst, label)
> > +if not dir and self._level >= VERIFY_FULL:
> >
> >
> > What does the "not dir" mean? I guess it's to do this check only for the
> > root directory when using tree manifests. Should we do it for all
> > directories?
>
> That is used earlier in the same function to denote "the root manifest".
> I think check the root manifest will trigger checks of the sub manifest
> but I am not sure, I am not too familiar tree manifest.


I'm pretty sure it's about tree manifests. I asked just to make sure since
it surprised me that you used that as part of the condition here.

Can we double
> check/fix this as a follow up ?
>

It should be easy to check (just add a print statement and run tests, for
example), so I don't see much reason to fix such a simple thing in a
follow-up.

Btw, it would be nice to have tests too, but I understand that that's
harder to do. Thoughts on how it could be done? Prepared bundle or some
python code for writing out a bad manifest entry should work, I guess.


> >
> > +try:
> > +# Manifest not in sorted order are invalid and
> > will crash
> > +# Mercurial. We restore each entry to make sure
> > they are
> >
> >
> > Nit: "restore" almost makes it sound like this is fixing broken entries.
> > Maybe something like "We read the full manifest at each revision to..."?
>
> Good point, V2, coming
>
> --
> Pierre-Yves David
>
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6231: rust-discovery: starting core implementation

2019-04-17 Thread kevincox (Kevin Cox)
kevincox added a comment.


  In https://phab.mercurial-scm.org/D6231#91102, @gracinet wrote:
  
  > I believe to have addressed your immediate concerns.
  >
  > I played with  splitting in different `struct`s for the various stages of 
the process. It is indeed cleaner and clearer Rust code.
  >  However mutating in place of `Enum`s exposed to Python is a bit of a 
headache, because of the wrapping in `RefCell>`, and I don't have a 
solution for that, so I'm gonna think about that in a follow-up.
  
  
  Thanks, it looks good for now :)

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6231

To: gracinet, #hg-reviewers, kevincox
Cc: durin42, kevincox, mjpieters, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6260: rust-discovery: takefullsample() core implementation

2019-04-17 Thread kevincox (Kevin Cox)
kevincox accepted this revision.
kevincox added inline comments.

INLINE COMMENTS

> discovery.rs:108
> +cur: usize,
> +}
> +

You might also consider an enum

  enum Parents {
Zero,
One(Revision),
Two(Revision, Revision),
  }

This also makes the iterator implementation a little clearer.

> discovery.rs:137
> +return self.next();
> +}
> +}

Can't you just call `self.next()` in both cases?

> discovery.rs:280
> +let mut children: HashMap> = HashMap::new();
> +for rev in self.undecided.as_ref().unwrap().iter().cloned() {
> +for p in self.graph.parents(rev)?.iter().cloned() {

Generally I would just do this.

  for  in self.undecided.as_ref().unwrap() {

> discovery.rs:281
> +for rev in self.undecided.as_ref().unwrap().iter().cloned() {
> +for p in self.graph.parents(rev)?.iter().cloned() {
> +if p != NULL_REVISION {

Same.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6260

To: gracinet, #hg-reviewers, kevincox
Cc: durin42, kevincox, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6259: [POC] revset: on-disk cache for children queries

2019-04-17 Thread joerg.sonnenberger (Joerg Sonnenberger)
joerg.sonnenberger added a comment.


  For the NetBSD repository, a trivial test with the new cache:
  
time hg log -r '1000~-400' -T {node} > /dev/null
real0m1.898s
time hg log -r '1000~-400' -T {node} > /dev/null
real0m0.170s
time hg log -r '1000~-1' -T {node} > /dev/null
real0m0.166s
time hg log -r '44~-1' -T {node} > /dev/null
real0m0.170s
  
  First one includes the time to initially warmup the cache.
  
  Without the cache:
  
time hg log -r '1000~0' -T {node} > /dev/null
real0m0.196s
time hg log -r '1000~-1' -T {node} > /dev/null
real0m0.825s
time hg log -r '1000~-2' -T {node} > /dev/null
real0m1.288s
time hg log -r '1000~-400' -T {node} > /dev/null
real3m23.201s
time hg log -r '44~-1' -T {node} > /dev/null
real0m0.182s
  
  In other words, building the cache is amortised by one or two queries for 
children early up in the tree. The cache still provides a good benefit nearer 
to tip.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6259

To: joerg.sonnenberger, #hg-reviewers
Cc: indygreg, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6263: Typos

2019-04-17 Thread joerg.sonnenberger (Joerg Sonnenberger)
joerg.sonnenberger created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6263

AFFECTED FILES
  mercurial/setdiscovery.py

CHANGE DETAILS

diff --git a/mercurial/setdiscovery.py b/mercurial/setdiscovery.py
--- a/mercurial/setdiscovery.py
+++ b/mercurial/setdiscovery.py
@@ -181,13 +181,13 @@
 self.missing = set()
 
 def addcommons(self, commons):
-"""registrer nodes known as common"""
+"""register nodes known as common"""
 self._common.addbases(commons)
 if self._undecided is not None:
 self._common.removeancestorsfrom(self._undecided)
 
 def addmissings(self, missings):
-"""registrer some nodes as missing"""
+"""register some nodes as missing"""
 newmissing = self._repo.revs('%ld::%ld', missings, self.undecided)
 if newmissing:
 self.missing.update(newmissing)



To: joerg.sonnenberger, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


  1   2   >