D9606: filemerge: add support for the new "mergediff" marker style to premerge

2020-12-14 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This adds support for the new "mergediff" conflict marker style to
  "merge-tools..premerge" (the new value is called
  "keep-mergediff").

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/filemerge.py
  mercurial/helptext/config.txt
  relnotes/next
  tests/test-merge-tools.t

CHANGE DETAILS

diff --git a/tests/test-merge-tools.t b/tests/test-merge-tools.t
--- a/tests/test-merge-tools.t
+++ b/tests/test-merge-tools.t
@@ -1255,6 +1255,46 @@
   # hg resolve --list
   R f
 
+premerge=keep-mergediff keeps conflict markers with base content:
+
+  $ beforemerge
+  [merge-tools]
+  false.whatever=
+  true.priority=1
+  true.executable=cat
+  # hg update -C 1
+  $ hg merge -r 4 --config merge-tools.true.premerge=keep-mergediff
+  merging f
+  <<<
+  --- base
+  +++ working copy: ef83787e2614 - test: revision 1
+  -revision 0
+  +revision 1
+   space
+  === merge rev:81448d39c9a0 - test: revision 4
+  revision 4
+  >>>
+  revision 0
+  space
+  revision 4
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ aftermerge
+  # cat f
+  <<<
+  --- base
+  +++ working copy: ef83787e2614 - test: revision 1
+  -revision 0
+  +revision 1
+   space
+  === merge rev:81448d39c9a0 - test: revision 4
+  revision 4
+  >>>
+  # hg stat
+  M f
+  # hg resolve --list
+  R f
+
 premerge=keep respects ui.mergemarkers=basic:
 
   $ beforemerge
diff --git a/relnotes/next b/relnotes/next
--- a/relnotes/next
+++ b/relnotes/next
@@ -33,7 +33,9 @@
`internal:merge3`, but it shows conflicts differently. Instead of
showing 2 or 3 snapshots of the conflicting pieces of code, it
shows one snapshot and a diff. This may be useful when at least one
-   side of the conflict is similar to the base.
+   side of the conflict is similar to the base. The new marker style
+   is also supported by "premerge" as
+   `merge-tools..premerge=keep-mergediff`.
 
 == New Experimental Features ==
 
diff --git a/mercurial/helptext/config.txt b/mercurial/helptext/config.txt
--- a/mercurial/helptext/config.txt
+++ b/mercurial/helptext/config.txt
@@ -1521,12 +1521,13 @@
 
 ``premerge``
   Attempt to run internal non-interactive 3-way merge tool before
-  launching external tool.  Options are ``true``, ``false``, ``keep`` or
-  ``keep-merge3``. The ``keep`` option will leave markers in the file if the
-  premerge fails. The ``keep-merge3`` will do the same but include information
-  about the base of the merge in the marker (see internal :merge3 in
-  :hg:`help merge-tools`).
-  (default: True)
+  launching external tool.  Options are ``true``, ``false``, ``keep``, 
+  ``keep-merge3``, or ``keep-mergediff`` (experimental). The ``keep`` option
+  will leave markers in the file if the premerge fails. The ``keep-merge3``
+  will do the same but include information about the base of the merge in the
+  marker (see internal :merge3 in :hg:`help merge-tools`). The
+  ``keep-mergediff`` option is similar but uses a different marker style
+  (see internal :merge3 in :hg:`help merge-tools`). (default: True)
 
 ``binary``
   This tool can merge binary files. (default: False, unless tool
diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -408,7 +408,7 @@
 
 ui = repo.ui
 
-validkeep = [b'keep', b'keep-merge3']
+validkeep = [b'keep', b'keep-merge3', b'keep-mergediff']
 
 # do we attempt to simplemerge first?
 try:
@@ -423,12 +423,16 @@
 )
 
 if premerge:
-if premerge == b'keep-merge3':
+mode = b'merge'
+if premerge in {b'keep-merge3', b'keep-mergediff'}:
 if not labels:
 labels = _defaultconflictlabels
 if len(labels) < 3:
 labels.append(b'base')
-r = simplemerge.simplemerge(ui, fcd, fca, fco, quiet=True, 
label=labels)
+if premerge == b'keep-mergediff':
+mode = b'mergediff'
+r = simplemerge.simplemerge(ui, fcd, fca, fco, quiet=True, 
label=labels,
+mode=mode)
 if not r:
 ui.debug(b" premerge successful\n")
 return 0



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


D9604: setup: exclude the git extension from py2 builds

2020-12-14 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This can't be built on Windows with the py2 compiler, and while old versions 
can
  be installed via pip on Linux, I can't get the tests to run (even with py3.8)
  using pygit2 0.28.2.  Some manually run commands work, and others spew stack
  traces that don't occur with the current 1.4.0 release using py3.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  setup.py

CHANGE DETAILS

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -1309,6 +1309,13 @@
 'hgdemandimport',
 ]
 
+# The pygit2 dependency dropped py2 support with the 1.0 release in Dec 2019.
+# Prior releases do not build at all on Windows, because Visual Studio 2008
+# doesn't understand C 11.  Older Linux releases are buggy.
+if sys.version_info[0] == 2:
+packages.remove('hgext.git')
+
+
 for name in os.listdir(os.path.join('mercurial', 'templates')):
 if name != '__pycache__' and os.path.isdir(
 os.path.join('mercurial', 'templates', name)



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


D9605: hook: set `HGPLAIN=1` for external hooks

2020-12-14 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  External hooks will probably turn around and run hg commands, so this seems 
like
  a reasonable convenience for people who miss it in the documentation.
  
  There are no test changes because `printenv.py` filters out anything without a
  "HG_" prefix.  It wouldn't be a useful test anyway, because this is already
  inherited from the test environment.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/hook.py

CHANGE DETAILS

diff --git a/mercurial/hook.py b/mercurial/hook.py
--- a/mercurial/hook.py
+++ b/mercurial/hook.py
@@ -157,6 +157,7 @@
 env[b'HG_PENDING'] = repo.root
 env[b'HG_HOOKTYPE'] = htype
 env[b'HG_HOOKNAME'] = name
+env[b'HGPLAIN'] = b'1'
 
 for k, v in pycompat.iteritems(args):
 # transaction changes can accumulate MBs of data, so skip it



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


[Bug 6456] New: Symbolic links on EXT4 encripted folder are being treated as always changed.

2020-12-14 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=6456

Bug ID: 6456
   Summary: Symbolic links on EXT4 encripted folder are being
treated as always changed.
   Product: Mercurial
   Version: 5.6.1
  Hardware: PC
OS: Linux
Status: UNCONFIRMED
  Severity: bug
  Priority: wish
 Component: Mercurial
  Assignee: bugzi...@mercurial-scm.org
  Reporter: core...@schuhen.net
CC: mercurial-devel@mercurial-scm.org
Python Version: ---

Created attachment 2091
  --> https://bz.mercurial-scm.org/attachment.cgi?id=2091=edit
Transcript of commands to cause bug.

I have setup my home directory to be incripted using fscrypt.
Example HOWTO: https://wiki.archlinux.org/index.php/Fscrypt

Any mercurial repositories cloned onto that FS always consider symlinks to be
'changed', they are reported in hg status but not hg diff. Comitting them has
only fix in that checkout, cloning again reports the same issue.

This issue is workable for normal commits because I usually use thg to review
and select but mercurial refuses to merge. The only work around I have is to
clone to another filesystem temporarily.

I wasn't sure if this is a bug in EXT4 (because it reports something
differently than it should) or in mercurial (because it is checking something
different than it should).

-- 
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


[RFC] Interaction between strip and caches

2020-12-14 Thread Joerg Sonnenberger
Hello all,
while looking at the revbranchcache, I noticed that it is doing quite an
expensive probalistic invalidation dance. It is essentially looking up
the revision in the changelog again and compares the first 32bit to see
if they (still) match. Other caches are doing cheaper checks like
remembering the head revision and node and checking it again to match.
The goal is in all cases to detect one of two cases:

(1) Repository additions by a hg instance without support for the cache.
(2) Repository removals by strip without update support specific to the
cache in use.

The first part is generally handled reasonable well and cheap. Keep
track of the number of revisions and process to all missing changesets
is something code has to support anyway. The real difficult problem is
the second part. I would like us to adopt a more explicit way of dealing
with this and opt-in support via a repository requirement. Given that
the strip command has finally become part of core, it looks like a good
time to do this now.

The first option is to require strip to nuke all caches that it can't
update. This is easy to implement and works reliable by nature with all
existing caches. It is also the more blunt option.

The second option is to keep a journal of strips. This can be a single
monotonically increasing counter and every cache just reads the counter
and rebuilds itself. Alternatively it could be a full journal that lists
the revisions and associated nodes removed. This requires changes to
existing caches but has the advantage that strip can be replayed by the
cache logic to avoid a full rebuild.

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


D9603: branchmap: refactor revbranchmap and use it as topicmap [PoC]

2020-12-14 Thread joerg.sonnenberger (Joerg Sonnenberger)
joerg.sonnenberger created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/branchmap.py
  mercurial/cacheutil.py
  mercurial/changegroup.py
  mercurial/changelog.py
  mercurial/commit.py
  mercurial/exchangev2.py
  mercurial/interfaces/repository.py
  mercurial/localrepo.py
  tests/test-acl.t
  tests/test-clone-uncompressed.t
  tests/test-clone.t
  tests/test-clonebundles.t
  tests/test-debugcommands.t
  tests/test-fncache.t
  tests/test-hardlinks.t
  tests/test-http-proxy.t
  tests/test-http.t
  tests/test-inherit-mode.t
  tests/test-keyword.t
  tests/test-mq-symlinks.t
  tests/test-push-http.t
  tests/test-rebase-conflicts.t
  tests/test-remote-hidden.t
  tests/test-server-view.t
  tests/test-share.t
  tests/test-ssh.t
  tests/test-stream-bundle-v2.t
  tests/test-tags.t
  tests/test-treemanifest.t

CHANGE DETAILS

diff --git a/tests/test-treemanifest.t b/tests/test-treemanifest.t
--- a/tests/test-treemanifest.t
+++ b/tests/test-treemanifest.t
@@ -792,7 +792,7 @@
   $ hg clone --config experimental.changegroup3=True --stream -U \
   >   http://localhost:$HGPORT1 stream-clone-basicstore
   streaming all changes
-  21 files to transfer, * of data (glob)
+  23 files to transfer, * of data (glob)
   transferred * in * seconds (*) (glob)
   $ hg -R stream-clone-basicstore verify
   checking changesets
@@ -806,7 +806,7 @@
   $ hg clone --config experimental.changegroup3=True --stream -U \
   >   http://localhost:$HGPORT2 stream-clone-encodedstore
   streaming all changes
-  21 files to transfer, * of data (glob)
+  23 files to transfer, * of data (glob)
   transferred * in * seconds (*) (glob)
   $ hg -R stream-clone-encodedstore verify
   checking changesets
@@ -820,7 +820,7 @@
   $ hg clone --config experimental.changegroup3=True --stream -U \
   >   http://localhost:$HGPORT stream-clone-fncachestore
   streaming all changes
-  22 files to transfer, * of data (glob)
+  24 files to transfer, * of data (glob)
   transferred * in * seconds (*) (glob)
   $ hg -R stream-clone-fncachestore verify
   checking changesets
diff --git a/tests/test-tags.t b/tests/test-tags.t
--- a/tests/test-tags.t
+++ b/tests/test-tags.t
@@ -724,6 +724,8 @@
   hgtagsfnodes1
   rbc-names-v1
   rbc-revs-v1
+  topic-names-v1
+  topic-revs-v1
 
 Cache should contain the head only, even though other nodes have tags data
 
@@ -749,6 +751,8 @@
   rbc-names-v1
   rbc-revs-v1
   tags2-visible
+  topic-names-v1
+  topic-revs-v1
 
   $ f --size --hexdump tagsclient/.hg/cache/hgtagsfnodes1
   tagsclient/.hg/cache/hgtagsfnodes1: size=96
diff --git a/tests/test-stream-bundle-v2.t b/tests/test-stream-bundle-v2.t
--- a/tests/test-stream-bundle-v2.t
+++ b/tests/test-stream-bundle-v2.t
@@ -46,7 +46,7 @@
   $ hg bundle -a --type="none-v2;stream=v2" bundle.hg
   $ hg debugbundle bundle.hg
   Stream params: {}
-  stream2 -- {bytecount: 1693, filecount: 11, requirements: 
dotencode%2Cfncache%2Cgeneraldelta%2Crevlogv1%2Csparserevlog%2Cstore} 
(mandatory: True)
+  stream2 -- {bytecount: 1740, filecount: 13, requirements: 
dotencode%2Cfncache%2Cgeneraldelta%2Crevlogv1%2Csparserevlog%2Cstore} 
(mandatory: True)
   $ hg debugbundle --spec bundle.hg
   
none-v2;stream=v2;requirements%3Ddotencode%2Cfncache%2Cgeneraldelta%2Crevlogv1%2Csparserevlog%2Cstore
 
@@ -71,7 +71,7 @@
   bundle2-input-bundle: with-transaction
   bundle2-input-part: "stream2" (params: 3 mandatory) supported
   applying stream bundle
-  11 files to transfer, 1.65 KB of data
+  13 files to transfer, 1.70 KB of data
   starting 4 threads for background file closing (?)
   starting 4 threads for background file closing (?)
   adding [s] data/A.i (66 bytes)
@@ -85,8 +85,10 @@
   adding [c] branch2-served (94 bytes)
   adding [c] rbc-names-v1 (7 bytes)
   adding [c] rbc-revs-v1 (40 bytes)
-  transferred 1.65 KB in \d\.\d seconds \(.*/sec\) (re)
-  bundle2-input-part: total payload size 1840
+  adding [c] topic-names-v1 (7 bytes)
+  adding [c] topic-revs-v1 (40 bytes)
+  transferred 1.70 KB in \d\.\d seconds \(.*/sec\) (re)
+  bundle2-input-part: total payload size 1920
   bundle2-input-bundle: 1 parts total
   updating the branch cache
   finished applying clone bundle
@@ -127,7 +129,7 @@
   bundle2-input-bundle: with-transaction
   bundle2-input-part: "stream2" (params: 3 mandatory) supported
   applying stream bundle
-  11 files to transfer, 1.65 KB of data
+  13 files to transfer, 1.70 KB of data
   starting 4 threads for background file closing (?)
   starting 4 threads for background file closing (?)
   adding [s] data/A.i (66 bytes)
@@ -141,8 +143,10 @@
   adding [c] branch2-served (94 bytes)
   adding [c] rbc-names-v1 (7 bytes)
   adding [c] rbc-revs-v1 (40 bytes)
-  transferred 1.65 KB in *.* seconds (*/sec) (glob)
-  bundle2-input-part: total payload size 1840
+  adding [c] topic-names-v1 (7 bytes)
+  adding 

D9601: errors: use detailed exit code 50 for StorageError

2020-12-14 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This is done as part of
  https://www.mercurial-scm.org/wiki/ErrorCategoriesPlan.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/scmutil.py
  tests/test-bundle-r.t
  tests/test-bundle.t
  tests/test-committer.t
  tests/test-convert-filemap.t
  tests/test-flagprocessor.t
  tests/test-grep.t
  tests/test-init.t
  tests/test-lfs-serve-access.t
  tests/test-lfs-test-server.t
  tests/test-lfs.t
  tests/test-mq-qrefresh.t
  tests/test-pull-bundle.t
  tests/test-requires.t
  tests/test-revlog-v2.t
  tests/test-revlog.t
  tests/test-username-newline.t

CHANGE DETAILS

diff --git a/tests/test-username-newline.t b/tests/test-username-newline.t
--- a/tests/test-username-newline.t
+++ b/tests/test-username-newline.t
@@ -23,5 +23,5 @@
   transaction abort!
   rollback completed
   abort: username 'foo\nbar3' contains a newline
-  [255]
+  [50]
 
diff --git a/tests/test-revlog.t b/tests/test-revlog.t
--- a/tests/test-revlog.t
+++ b/tests/test-revlog.t
@@ -8,7 +8,7 @@
 
   $ hg log
   abort: unknown flags (0x01) in version 0 revlog 00changelog.i
-  [255]
+  [50]
 
 Unknown flags on revlog version 1 are rejected
 
@@ -17,7 +17,7 @@
 
   $ hg log
   abort: unknown flags (0x04) in version 1 revlog 00changelog.i
-  [255]
+  [50]
 
 Unknown version is rejected
 
@@ -26,7 +26,7 @@
 
   $ hg log
   abort: unknown version (2) in revlog 00changelog.i
-  [255]
+  [50]
 
   $ cd ..
 
diff --git a/tests/test-revlog-v2.t b/tests/test-revlog-v2.t
--- a/tests/test-revlog-v2.t
+++ b/tests/test-revlog-v2.t
@@ -36,7 +36,7 @@
 
   $ hg log
   abort: unknown flags (0xff00) in version 57005 revlog 00changelog.i
-  [255]
+  [50]
 
   $ cd ..
 
diff --git a/tests/test-requires.t b/tests/test-requires.t
--- a/tests/test-requires.t
+++ b/tests/test-requires.t
@@ -6,7 +6,7 @@
   $ rm .hg/requires
   $ hg tip
   abort: unknown version (2) in revlog 00changelog.i
-  [255]
+  [50]
   $ echo indoor-pool > .hg/requires
   $ hg tip
   abort: repository requires features unknown to this Mercurial: indoor-pool
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
@@ -186,7 +186,7 @@
   adding manifests
   adding file changes
   abort: 00changelog.i@66f7d451a68b: no node
-  [255]
+  [50]
   $ cd ..
   $ killdaemons.py
   $ grep 'sending pullbundle ' repo/.hg/blackbox.log
diff --git a/tests/test-mq-qrefresh.t b/tests/test-mq-qrefresh.t
--- a/tests/test-mq-qrefresh.t
+++ b/tests/test-mq-qrefresh.t
@@ -505,7 +505,7 @@
   rollback completed
   qrefresh interrupted while patch was popped! (revert --all, qpush to recover)
   abort: username 'foo\nbar' contains a newline
-  [255]
+  [50]
   $ rm a
   $ cat .hg/patches/a
   # HG changeset patch
@@ -521,7 +521,7 @@
   rollback completed
   qrefresh interrupted while patch was popped! (revert --all, qpush to recover)
   abort: empty username
-  [255]
+  [50]
   $ cat .hg/patches/a
   # HG changeset patch
   # Parent  
diff --git a/tests/test-lfs.t b/tests/test-lfs.t
--- a/tests/test-lfs.t
+++ b/tests/test-lfs.t
@@ -986,7 +986,7 @@
 
   $ hg --cwd fromcorrupt2 cat -r 0 large
   abort: integrity check failed on data/large.i:0
-  [255]
+  [50]
 
 lfs -> normal -> lfs round trip conversions are possible.  The 'none()'
 predicate on the command line will override whatever is configured globally and
diff --git a/tests/test-lfs-test-server.t b/tests/test-lfs-test-server.t
--- a/tests/test-lfs-test-server.t
+++ b/tests/test-lfs-test-server.t
@@ -460,7 +460,7 @@
   Date: $HTTP_DATE$ (git-server !)
   abort: corrupt remote lfs object: 
d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (git-server !)
   abort: LFS server error for "c": Validation error (hg-server !)
-  [255]
+  [50]
 
 The corrupted blob is not added to the usercache or local store
 
@@ -827,7 +827,7 @@
 "transfer": "basic" (hg-server !)
   }
   abort: LFS server error for "b": The object does not exist
-  [255]
+  [50]
 
 Check error message when object does not exist:
 
@@ -938,6 +938,6 @@
 "transfer": "basic" (hg-server !)
   }
   abort: LFS server error for "a": The object does not exist
-  [255]
+  [50]
 
   $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
diff --git a/tests/test-lfs-serve-access.t b/tests/test-lfs-serve-access.t
--- a/tests/test-lfs-serve-access.t
+++ b/tests/test-lfs-serve-access.t
@@ -32,7 +32,7 @@
   searching for changes
   abort: LFS HTTP error: HTTP Error 400: no such method: .git
   (check that lfs serving is enabled on http://localhost:$HGPORT/.git/info/lfs 
and "upload" is supported)
-  [255]
+  [50]
 
 ... so do a local push to make the data available.  Remove the blob from the
 default cache, so it attempts to download.
@@ -54,7 +54,7 @@
   updating to branch default
   

D9600: errors: raise InputError if an ambiguous revision id prefix is used

2020-12-14 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  It's long bothered me that way include the "00changelog.i" part in a
  message to the user. This fixes that along with the exit code.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/revset.py
  mercurial/scmutil.py
  tests/test-revisions.t
  tests/test-revset.t

CHANGE DETAILS

diff --git a/tests/test-revset.t b/tests/test-revset.t
--- a/tests/test-revset.t
+++ b/tests/test-revset.t
@@ -1873,8 +1873,8 @@
   3
   $ hg log --template '{rev}\n' -r 'id(x)'
   $ hg log --template '{rev}\n' -r 'x'
-  abort: 00changelog.i@: ambiguous identifier
-  [255]
+  abort: ambiguous revision identifier: x
+  [10]
   $ log 'id(23268)'
   4
   $ log 'id(2785f51eece)'
@@ -2040,14 +2040,14 @@
   obsoleted 1 changesets
 
   $ hg debugrevspec 'fff'
-  abort: 00changelog.i@fff: ambiguous identifier
-  [255]
+  abort: ambiguous revision identifier: fff
+  [10]
   $ hg debugrevspec ''
-  abort: 00changelog.i@: ambiguous identifier
-  [255]
+  abort: ambiguous revision identifier: 
+  [10]
   $ hg debugrevspec 'fffb'
-  abort: 00changelog.i@fffb: ambiguous identifier
-  [255]
+  abort: ambiguous revision identifier: fffb
+  [10]
 BROKEN should be '2' (node lookup uses unfiltered repo)
   $ hg debugrevspec 'id(fffb)'
 BROKEN should be '2' (node lookup uses unfiltered repo)
diff --git a/tests/test-revisions.t b/tests/test-revisions.t
--- a/tests/test-revisions.t
+++ b/tests/test-revisions.t
@@ -36,8 +36,8 @@
   1:9
 7 was ambiguous and still is
   $ hg l -r 7
-  abort: 00changelog.i@7: ambiguous identifier
-  [255]
+  abort: ambiguous revision identifier: 7
+  [10]
 7b is no longer ambiguous
   $ hg l -r 7b
   3:7b
diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -1798,7 +1798,7 @@
 k = encoding.tolocal(k)
 try:
 data[revsingle(repo, k).rev()] = encoding.tolocal(v)
-except (error.LookupError, error.RepoLookupError):
+except (error.LookupError, error.RepoLookupError, 
error.InputError):
 pass  # we ignore data for nodes that don't exist locally
 finally:
 if proc:
diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -2690,7 +2690,15 @@
 
 
 def lookupfn(repo):
-return lambda symbol: scmutil.isrevsymbol(repo, symbol)
+def fn(symbol):
+try:
+return scmutil.isrevsymbol(repo, symbol)
+except error.AmbiguousPrefixLookupError:
+raise error.InputError(
+b'ambiguous revision identifier: %s' % symbol
+)
+
+return fn
 
 
 def match(ui, spec, lookup=None):



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


D9602: errors: raise InputError on recursive template definition

2020-12-14 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/templater.py
  tests/test-template-basic.t

CHANGE DETAILS

diff --git a/tests/test-template-basic.t b/tests/test-template-basic.t
--- a/tests/test-template-basic.t
+++ b/tests/test-template-basic.t
@@ -265,7 +265,7 @@
   > EOF
   $ hg log --style ./issue4758
   abort: recursive reference 'changeset' in template
-  [255]
+  [10]
 
  not a recursion if a keyword of the same name exists:
 
diff --git a/mercurial/templater.py b/mercurial/templater.py
--- a/mercurial/templater.py
+++ b/mercurial/templater.py
@@ -451,7 +451,7 @@
 
 
 def _runrecursivesymbol(context, mapping, key):
-raise error.Abort(_(b"recursive reference '%s' in template") % key)
+raise error.InputError(_(b"recursive reference '%s' in template") % key)
 
 
 def buildtemplate(exp, context):



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


D9599: localrepo: delete obsolete comment about `prefix in repo` raising exception

2020-12-14 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  We dropped support for `prefix in repo`, where `prefix` is a hex
  prefix, in 8b86acc7aa64 
 
(context: drop support for looking up context
  by ambiguous changeid (API), 2018-04-28), after having deprecated it a
  while before that. These days you get a `ProgrammingError` instead if
  you pass in a short nodeid.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/localrepo.py

CHANGE DETAILS

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1754,11 +1754,7 @@
 return context.workingctx(self)
 
 def __contains__(self, changeid):
-"""True if the given changeid exists
-
-error.AmbiguousPrefixLookupError is raised if an ambiguous node
-specified.
-"""
+"""True if the given changeid exists"""
 try:
 self[changeid]
 return True



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


D9598: share: propery copy cache files when cloning from a share

2020-12-14 Thread joerg.sonnenberger (Joerg Sonnenberger)
joerg.sonnenberger created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  If a is shared to b and b cloned to c, the old code would look directly
  under b/.hg for the cache directory and not use the cachevfs layer to
  pick the members from a/.hg/cache. Adjust variable names and comments to
  reflect that the function is used for more than just the branchmap
  cache.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/hg.py
  tests/test-share.t

CHANGE DETAILS

diff --git a/tests/test-share.t b/tests/test-share.t
--- a/tests/test-share.t
+++ b/tests/test-share.t
@@ -56,6 +56,17 @@
   rbc-revs-v1
   tags2-visible
 
+Cloning a shared repo should pick up the full cache dir on the other hand.
+
+  $ hg clone . ../repo2-clone
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ ls -1 ../repo2-clone/.hg/cache
+  branch2-served
+  rbc-names-v1
+  rbc-revs-v1
+  tags2-visible
+
 Some sed versions appends newline, some don't, and some just fails
 
   $ cat .hg/sharedpath; echo
diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -590,16 +590,15 @@
 return srcpeer, peer(ui, peeropts, dest)
 
 
-# Recomputing branch cache might be slow on big repos,
-# so just copy it
+# Recomputing caches is often slow on big repos, so copy them.
 def _copycache(srcrepo, dstcachedir, fname):
 """copy a cache from srcrepo to destcachedir (if it exists)"""
-srcbranchcache = srcrepo.vfs.join(b'cache/%s' % fname)
-dstbranchcache = os.path.join(dstcachedir, fname)
-if os.path.exists(srcbranchcache):
+srcfname = srcrepo.cachevfs.join(fname)
+dstfname = os.path.join(dstcachedir, fname)
+if os.path.exists(srcfname):
 if not os.path.exists(dstcachedir):
 os.mkdir(dstcachedir)
-util.copyfile(srcbranchcache, dstbranchcache)
+util.copyfile(srcfname, dstfname)
 
 
 def clone(



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


D9597: tests: workaround for a flacky test

2020-12-14 Thread joerg.sonnenberger (Joerg Sonnenberger)
joerg.sonnenberger created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  tests/test-wireproto-exchangev2-shallow.t

CHANGE DETAILS

diff --git a/tests/test-wireproto-exchangev2-shallow.t 
b/tests/test-wireproto-exchangev2-shallow.t
--- a/tests/test-wireproto-exchangev2-shallow.t
+++ b/tests/test-wireproto-exchangev2-shallow.t
@@ -98,13 +98,14 @@
   received frame(size=9; request=1; stream=2; streamflags=stream-begin; 
type=stream-settings; flags=eos)
   received frame(size=11; request=1; stream=2; streamflags=encoded; 
type=command-response; flags=continuation)
   received frame(size=1170; request=1; stream=2; streamflags=encoded; 
type=command-response; flags=continuation)
-  received frame(size=0; request=1; stream=2; streamflags=; 
type=command-response; flags=eos)
+  received frame(size=0; request=1; stream=2; streamflags=; 
type=command-response; flags=eos) (?)
   add changeset 3390ef850073
   add changeset b709380892b1
   add changeset 47fe012ab237
   add changeset 97765fc3cd62
   add changeset dc666cf9ecf3
   add changeset 93a8bd067ed2
+  received frame(size=0; request=1; stream=2; streamflags=; 
type=command-response; flags=eos) (?)
   checking for updated bookmarks
   sending 1 commands
   sending command manifestdata: {
@@ -402,11 +403,12 @@
   received frame(size=9; request=1; stream=2; streamflags=stream-begin; 
type=stream-settings; flags=eos)
   received frame(size=11; request=1; stream=2; streamflags=encoded; 
type=command-response; flags=continuation)
   received frame(size=783; request=1; stream=2; streamflags=encoded; 
type=command-response; flags=continuation)
-  received frame(size=0; request=1; stream=2; streamflags=; 
type=command-response; flags=eos)
+  received frame(size=0; request=1; stream=2; streamflags=; 
type=command-response; flags=eos) (?)
   add changeset 3390ef850073
   add changeset b709380892b1
   add changeset 47fe012ab237
   add changeset 97765fc3cd62
+  received frame(size=0; request=1; stream=2; streamflags=; 
type=command-response; flags=eos) (?)
   checking for updated bookmarks
   sending 1 commands
   sending command manifestdata: {
@@ -515,9 +517,10 @@
   received frame(size=9; request=1; stream=2; streamflags=stream-begin; 
type=stream-settings; flags=eos)
   received frame(size=11; request=1; stream=2; streamflags=encoded; 
type=command-response; flags=continuation)
   received frame(size=400; request=1; stream=2; streamflags=encoded; 
type=command-response; flags=continuation)
-  received frame(size=0; request=1; stream=2; streamflags=; 
type=command-response; flags=eos)
+  received frame(size=0; request=1; stream=2; streamflags=; 
type=command-response; flags=eos) (?)
   add changeset dc666cf9ecf3
   add changeset 93a8bd067ed2
+  received frame(size=0; request=1; stream=2; streamflags=; 
type=command-response; flags=eos) (?)
   checking for updated bookmarks
   sending 1 commands
   sending command manifestdata: {



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


D9596: rust: introduce Repo and Vfs types for filesystem abstraction

2020-12-14 Thread SimonSapin
SimonSapin created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This is similar to the corresponding Python classes.
  
  Repo represents a repository and knows the path to the `.hg` directory,
  the `store` directory, and the working directory.
  Separating these will enable supporting the share extension.
  
  A Vfs is created from a Repo for one of these three directories.
  It has filesystem access APIs that take a relative std::path::Path
  as a parameter.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  rust/hg-core/src/lib.rs
  rust/hg-core/src/operations/cat.rs
  rust/hg-core/src/operations/debugdata.rs
  rust/hg-core/src/operations/list_tracked_files.rs
  rust/hg-core/src/repo.rs
  rust/hg-core/src/requirements.rs
  rust/hg-core/src/revlog/changelog.rs
  rust/hg-core/src/revlog/manifest.rs
  rust/hg-core/src/revlog/revlog.rs
  rust/rhg/src/commands/cat.rs
  rust/rhg/src/commands/debugdata.rs
  rust/rhg/src/commands/debugrequirements.rs
  rust/rhg/src/commands/files.rs
  rust/rhg/src/commands/root.rs

CHANGE DETAILS

diff --git a/rust/rhg/src/commands/root.rs b/rust/rhg/src/commands/root.rs
--- a/rust/rhg/src/commands/root.rs
+++ b/rust/rhg/src/commands/root.rs
@@ -2,7 +2,7 @@
 use crate::error::CommandError;
 use crate::ui::Ui;
 use format_bytes::format_bytes;
-use hg::operations::find_root;
+use hg::repo::Repo;
 use hg::utils::files::get_bytes_from_path;
 
 pub const HELP_TEXT:  = "
@@ -21,12 +21,9 @@
 
 impl Command for RootCommand {
 fn run(, ui: ) -> Result<(), CommandError> {
-let path_buf = find_root()?;
-
-let bytes = get_bytes_from_path(path_buf);
-
+let repo = Repo::find()?;
+let bytes = get_bytes_from_path(repo.working_directory_path());
 ui.write_stdout(_bytes!(b"{}\n", bytes.as_slice()))?;
-
 Ok(())
 }
 }
diff --git a/rust/rhg/src/commands/files.rs b/rust/rhg/src/commands/files.rs
--- a/rust/rhg/src/commands/files.rs
+++ b/rust/rhg/src/commands/files.rs
@@ -2,7 +2,6 @@
 use crate::error::{CommandError, CommandErrorKind};
 use crate::ui::utf8_to_local;
 use crate::ui::Ui;
-use hg::operations::find_root;
 use hg::operations::{
 list_rev_tracked_files, ListRevTrackedFilesError,
 ListRevTrackedFilesErrorKind,
@@ -10,10 +9,9 @@
 use hg::operations::{
 Dirstate, ListDirstateTrackedFilesError, ListDirstateTrackedFilesErrorKind,
 };
-use hg::requirements;
+use hg::repo::Repo;
 use hg::utils::files::{get_bytes_from_path, relativize_path};
 use hg::utils::hg_path::{HgPath, HgPathBuf};
-use std::path::Path;
 
 pub const HELP_TEXT:  = "
 List tracked files.
@@ -33,13 +31,13 @@
 fn display_files(
 ,
 ui: ,
-root: ,
+repo: ,
 files: impl IntoIterator,
 ) -> Result<(), CommandError> {
 let cwd = std::env::current_dir()
 .or_else(|e| Err(CommandErrorKind::CurrentDirNotFound(e)))?;
 let rooted_cwd = cwd
-.strip_prefix(root)
+.strip_prefix(repo.working_directory_path())
 .expect("cwd was already checked within the repository");
 let rooted_cwd = HgPathBuf::from(get_bytes_from_path(rooted_cwd));
 
@@ -56,16 +54,16 @@
 
 impl<'a> Command for FilesCommand<'a> {
 fn run(, ui: ) -> Result<(), CommandError> {
-let root = find_root()?;
-requirements::check()?;
+let repo = Repo::find()?;
+repo.check_requirements()?;
 if let Some(rev) = self.rev {
-let files = list_rev_tracked_files(, rev)
+let files = list_rev_tracked_files(, rev)
 .map_err(|e| map_rev_error(rev, e))?;
-self.display_files(ui, , files.iter())
+self.display_files(ui, , files.iter())
 } else {
-let distate = Dirstate::new().map_err(map_dirstate_error)?;
+let distate = Dirstate::new().map_err(map_dirstate_error)?;
 let files = distate.tracked_files().map_err(map_dirstate_error)?;
-self.display_files(ui, , files)
+self.display_files(ui, , files)
 }
 }
 }
diff --git a/rust/rhg/src/commands/debugrequirements.rs 
b/rust/rhg/src/commands/debugrequirements.rs
--- a/rust/rhg/src/commands/debugrequirements.rs
+++ b/rust/rhg/src/commands/debugrequirements.rs
@@ -1,7 +1,7 @@
 use crate::commands::Command;
 use crate::error::CommandError;
 use crate::ui::Ui;
-use hg::operations::find_root;
+use hg::repo::Repo;
 use hg::requirements;
 
 pub const HELP_TEXT:  = "
@@ -18,9 +18,9 @@
 
 impl Command for DebugRequirementsCommand {
 fn run(, ui: ) -> Result<(), CommandError> {
-let root = find_root()?;
+let repo = Repo::find()?;
 let mut output = String::new();
-for req in requirements::load()? {
+for req in requirements::load()? {
 output.push_str();
 output.push('\n');
 }
diff 

D9595: rust: replace most "operation" structs with functions

2020-12-14 Thread SimonSapin
SimonSapin created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  The hg-core crate has a partially-formed concept of "operation",
  represented as structs with constructors and a `run` method.
  
  Each struct’s contructor takes different parameters,
  and each `run` has a different return type.
  Constructors typically don’t do much more than store parameters
  for `run` to access them.
  
  There was a comment about adding an `Operation` trait
  when the language supports expressing something so general,
  but it’s hard to imagine how operations with such different APIs
  could be used in a generic context.
  
  This commit starts removing the concept of "operation",
  since those are pretty much just functions.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  rust/hg-core/src/operations/cat.rs
  rust/hg-core/src/operations/debugdata.rs
  rust/hg-core/src/operations/find_root.rs
  rust/hg-core/src/operations/list_tracked_files.rs
  rust/hg-core/src/operations/mod.rs
  rust/rhg/src/commands/cat.rs
  rust/rhg/src/commands/debugdata.rs
  rust/rhg/src/commands/debugrequirements.rs
  rust/rhg/src/commands/files.rs
  rust/rhg/src/commands/root.rs

CHANGE DETAILS

diff --git a/rust/rhg/src/commands/root.rs b/rust/rhg/src/commands/root.rs
--- a/rust/rhg/src/commands/root.rs
+++ b/rust/rhg/src/commands/root.rs
@@ -2,7 +2,7 @@
 use crate::error::CommandError;
 use crate::ui::Ui;
 use format_bytes::format_bytes;
-use hg::operations::FindRoot;
+use hg::operations::find_root;
 use hg::utils::files::get_bytes_from_path;
 
 pub const HELP_TEXT:  = "
@@ -21,7 +21,7 @@
 
 impl Command for RootCommand {
 fn run(, ui: ) -> Result<(), CommandError> {
-let path_buf = FindRoot::new().run()?;
+let path_buf = find_root()?;
 
 let bytes = get_bytes_from_path(path_buf);
 
diff --git a/rust/rhg/src/commands/files.rs b/rust/rhg/src/commands/files.rs
--- a/rust/rhg/src/commands/files.rs
+++ b/rust/rhg/src/commands/files.rs
@@ -2,14 +2,13 @@
 use crate::error::{CommandError, CommandErrorKind};
 use crate::ui::utf8_to_local;
 use crate::ui::Ui;
-use hg::operations::FindRoot;
+use hg::operations::find_root;
 use hg::operations::{
-ListDirstateTrackedFiles, ListDirstateTrackedFilesError,
-ListDirstateTrackedFilesErrorKind,
+list_rev_tracked_files, ListRevTrackedFilesError,
+ListRevTrackedFilesErrorKind,
 };
 use hg::operations::{
-ListRevTrackedFiles, ListRevTrackedFilesError,
-ListRevTrackedFilesErrorKind,
+Dirstate, ListDirstateTrackedFilesError, ListDirstateTrackedFilesErrorKind,
 };
 use hg::requirements;
 use hg::utils::files::{get_bytes_from_path, relativize_path};
@@ -57,17 +56,15 @@
 
 impl<'a> Command for FilesCommand<'a> {
 fn run(, ui: ) -> Result<(), CommandError> {
-let root = FindRoot::new().run()?;
+let root = find_root()?;
 requirements::check()?;
 if let Some(rev) = self.rev {
-let mut operation = ListRevTrackedFiles::new(, rev)
+let files = list_rev_tracked_files(, rev)
 .map_err(|e| map_rev_error(rev, e))?;
-let files = operation.run().map_err(|e| map_rev_error(rev, e))?;
-self.display_files(ui, , files)
+self.display_files(ui, , files.iter())
 } else {
-let mut operation = ListDirstateTrackedFiles::new()
-.map_err(map_dirstate_error)?;
-let files = operation.run().map_err(map_dirstate_error)?;
+let distate = Dirstate::new().map_err(map_dirstate_error)?;
+let files = distate.tracked_files().map_err(map_dirstate_error)?;
 self.display_files(ui, , files)
 }
 }
diff --git a/rust/rhg/src/commands/debugrequirements.rs 
b/rust/rhg/src/commands/debugrequirements.rs
--- a/rust/rhg/src/commands/debugrequirements.rs
+++ b/rust/rhg/src/commands/debugrequirements.rs
@@ -1,7 +1,7 @@
 use crate::commands::Command;
 use crate::error::CommandError;
 use crate::ui::Ui;
-use hg::operations::FindRoot;
+use hg::operations::find_root;
 use hg::requirements;
 
 pub const HELP_TEXT:  = "
@@ -18,7 +18,7 @@
 
 impl Command for DebugRequirementsCommand {
 fn run(, ui: ) -> Result<(), CommandError> {
-let root = FindRoot::new().run()?;
+let root = find_root()?;
 let mut output = String::new();
 for req in requirements::load()? {
 output.push_str();
diff --git a/rust/rhg/src/commands/debugdata.rs 
b/rust/rhg/src/commands/debugdata.rs
--- a/rust/rhg/src/commands/debugdata.rs
+++ b/rust/rhg/src/commands/debugdata.rs
@@ -2,8 +2,9 @@
 use crate::error::{CommandError, CommandErrorKind};
 use crate::ui::utf8_to_local;
 use crate::ui::Ui;
+use hg::operations::find_root;
 use hg::operations::{
-DebugData, DebugDataError, DebugDataErrorKind, DebugDataKind,
+debug_data, DebugDataError, 

D9594: rust: change parameters to

2020-12-14 Thread SimonSapin
SimonSapin created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This is just as useful in function bodies, and a less strict requirement for 
callers.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  rust/hg-core/src/operations/cat.rs
  rust/hg-core/src/operations/list_tracked_files.rs
  rust/hg-core/src/revlog/changelog.rs
  rust/hg-core/src/revlog/manifest.rs
  rust/rhg/src/commands/files.rs

CHANGE DETAILS

diff --git a/rust/rhg/src/commands/files.rs b/rust/rhg/src/commands/files.rs
--- a/rust/rhg/src/commands/files.rs
+++ b/rust/rhg/src/commands/files.rs
@@ -14,7 +14,7 @@
 use hg::requirements;
 use hg::utils::files::{get_bytes_from_path, relativize_path};
 use hg::utils::hg_path::{HgPath, HgPathBuf};
-use std::path::PathBuf;
+use std::path::Path;
 
 pub const HELP_TEXT:  = "
 List tracked files.
@@ -34,13 +34,13 @@
 fn display_files(
 ,
 ui: ,
-root: ,
+root: ,
 files: impl IntoIterator,
 ) -> Result<(), CommandError> {
 let cwd = std::env::current_dir()
 .or_else(|e| Err(CommandErrorKind::CurrentDirNotFound(e)))?;
 let rooted_cwd = cwd
-.strip_prefix()
+.strip_prefix(root)
 .expect("cwd was already checked within the repository");
 let rooted_cwd = HgPathBuf::from(get_bytes_from_path(rooted_cwd));
 
diff --git a/rust/hg-core/src/revlog/manifest.rs 
b/rust/hg-core/src/revlog/manifest.rs
--- a/rust/hg-core/src/revlog/manifest.rs
+++ b/rust/hg-core/src/revlog/manifest.rs
@@ -2,7 +2,7 @@
 use crate::revlog::NodePrefixRef;
 use crate::revlog::Revision;
 use crate::utils::hg_path::HgPath;
-use std::path::PathBuf;
+use std::path::Path;
 
 /// A specialized `Revlog` to work with `manifest` data format.
 pub struct Manifest {
@@ -12,7 +12,7 @@
 
 impl Manifest {
 /// Open the `manifest` of a repository given by its root.
-pub fn open(root: ) -> Result {
+pub fn open(root: ) -> Result {
 let index_file = root.join(".hg/store/00manifest.i");
 let revlog = Revlog::open(_file, None)?;
 Ok(Self { revlog })
diff --git a/rust/hg-core/src/revlog/changelog.rs 
b/rust/hg-core/src/revlog/changelog.rs
--- a/rust/hg-core/src/revlog/changelog.rs
+++ b/rust/hg-core/src/revlog/changelog.rs
@@ -1,7 +1,7 @@
 use crate::revlog::revlog::{Revlog, RevlogError};
 use crate::revlog::NodePrefixRef;
 use crate::revlog::Revision;
-use std::path::PathBuf;
+use std::path::Path;
 
 /// A specialized `Revlog` to work with `changelog` data format.
 pub struct Changelog {
@@ -11,7 +11,7 @@
 
 impl Changelog {
 /// Open the `changelog` of a repository given by its root.
-pub fn open(root: ) -> Result {
+pub fn open(root: ) -> Result {
 let index_file = root.join(".hg/store/00changelog.i");
 let revlog = Revlog::open(_file, None)?;
 Ok(Self { revlog })
diff --git a/rust/hg-core/src/operations/list_tracked_files.rs 
b/rust/hg-core/src/operations/list_tracked_files.rs
--- a/rust/hg-core/src/operations/list_tracked_files.rs
+++ b/rust/hg-core/src/operations/list_tracked_files.rs
@@ -16,7 +16,7 @@
 use rayon::prelude::*;
 use std::convert::From;
 use std::fs;
-use std::path::PathBuf;
+use std::path::Path;
 
 /// Kind of error encountered by `ListDirstateTrackedFiles`
 #[derive(Debug)]
@@ -57,7 +57,7 @@
 }
 
 impl ListDirstateTrackedFiles {
-pub fn new(root: ) -> Result {
+pub fn new(root: ) -> Result {
 let dirstate = root.join(".hg/dirstate");
 let content = fs::read()?;
 Ok(Self { content })
@@ -152,11 +152,11 @@
 
 impl<'a> ListRevTrackedFiles<'a> {
 pub fn new(
-root: ,
+root: ,
 rev: &'a str,
 ) -> Result {
-let changelog = Changelog::open()?;
-let manifest = Manifest::open()?;
+let changelog = Changelog::open(root)?;
+let manifest = Manifest::open(root)?;
 
 Ok(Self {
 rev,
diff --git a/rust/hg-core/src/operations/cat.rs 
b/rust/hg-core/src/operations/cat.rs
--- a/rust/hg-core/src/operations/cat.rs
+++ b/rust/hg-core/src/operations/cat.rs
@@ -71,7 +71,7 @@
 
 /// List files under Mercurial control at a given revision.
 pub struct CatRev<'a> {
-root: &'a PathBuf,
+root: &'a Path,
 /// The revision to cat the files from.
 rev: &'a str,
 /// The files to output.
@@ -88,7 +88,7 @@
 
 impl<'a> CatRev<'a> {
 pub fn new(
-root: &'a PathBuf,
+root: &'a Path,
 rev: &'a str,
 files: &'a [HgPathBuf],
 ) -> Result {



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


mercurial@46112: 5 new changesets

2020-12-14 Thread Mercurial Commits
5 new changesets in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/bdc2bf68f19e
changeset:   46108:bdc2bf68f19e
user:Martin von Zweigbergk 
date:Tue Dec 08 16:45:13 2020 -0800
summary: mergetools: add new conflict marker format with diffs in

https://www.mercurial-scm.org/repo/hg/rev/2f357d053df2
changeset:   46109:2f357d053df2
user:Kyle Lippincott 
date:Fri Dec 11 13:39:56 2020 -0800
summary: copies: make calculating lazy for dir move detection's "addedfiles"

https://www.mercurial-scm.org/repo/hg/rev/d90f439ff19f
changeset:   46110:d90f439ff19f
user:Pierre-Yves David 
date:Fri Dec 11 12:51:09 2020 +0100
summary: debugdiscovery: display the number of roundtrip used

https://www.mercurial-scm.org/repo/hg/rev/9e24b3d8e896
changeset:   46111:9e24b3d8e896
user:Pierre-Yves David 
date:Fri Dec 11 15:25:11 2020 +0100
summary: debugdiscovery: fix swapped heads and roots

https://www.mercurial-scm.org/repo/hg/rev/d6afa9c149c3
changeset:   46112:d6afa9c149c3
bookmark:@
tag: tip
parent:  46111:9e24b3d8e896
parent:  46081:734d051d0efb
user:Martin von Zweigbergk 
date:Sun Dec 13 18:29:22 2020 -0800
summary: branching: merge with stable

-- 
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


D9593: test-narrow: mitigate the flakyness of test-narrow-shallow

2020-12-14 Thread marmoute (Pierre-Yves David)
marmoute created this revision.
Herald added a reviewer: durin42.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  The actual bug still need fixing, but in the meantime the flakyness is wasting
  everybody's time.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

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

AFFECTED FILES
  tests/test-narrow-shallow.t

CHANGE DETAILS

diff --git a/tests/test-narrow-shallow.t b/tests/test-narrow-shallow.t
--- a/tests/test-narrow-shallow.t
+++ b/tests/test-narrow-shallow.t
@@ -91,15 +91,23 @@
   2: Commit rev2 of f9, d1/f9, d2/f9
   1: Commit rev2 of f8, d1/f8, d2/f8
   0...: Commit rev2 of f7, d1/f7, d2/f7
+
+XXX flaky output (see issue6150)
+XXX
+XXX The filectx implementation is buggy and return wrong data during status.
+XXX Leading to more file being "merged". The right output is the one with just
+XXX 10 files updated.
+
   $ hg update 4
-  merging d2/f1
-  merging d2/f2
-  merging d2/f3
-  merging d2/f4
-  merging d2/f5
-  merging d2/f6
-  merging d2/f7
-  3 files updated, 7 files merged, 0 files removed, 0 files unresolved
+  merging d2/f1 (?)
+  merging d2/f2 (?)
+  merging d2/f3 (?)
+  merging d2/f4 (?)
+  merging d2/f5 (?)
+  merging d2/f6 (?)
+  merging d2/f7 (?)
+  3 files updated, 7 files merged, 0 files removed, 0 files unresolved (?)
+  10 files updated, 0 files merged, 0 files removed, 0 files unresolved (?)
   $ cat d2/f7 d2/f8
   d2/f7 rev3
   d2/f8 rev2



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


D9592: copies: deal with the "same revision" special case earlier

2020-12-14 Thread marmoute (Pierre-Yves David)
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This can happens a lot in case of deletion so we better deal with it early.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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
@@ -479,15 +479,17 @@
 
 def _compare_values(changes, isancestor, dest, minor, major):
 """compare two value within a _merge_copies_dict loop iteration"""
-major_tt = major[0]
-minor_tt = minor[0]
+major_tt, major_value = major
+minor_tt, minor_value = minor
 
-if major[1] == minor[1]:
+if major_tt == minor_tt:
+# if it comes from the same revision it must be the same value
+assert major_value == minor_value
+return PICK_EITHER
+elif major[1] == minor[1]:
 return PICK_EITHER
 # content from "major" wins, unless it is older
 # than the branch point or there is a merge
-if major_tt == minor_tt:
-return PICK_MAJOR
 elif changes is not None and major[1] is None and dest in changes.salvaged:
 return PICK_MINOR
 elif changes is not None and minor[1] is None and dest in changes.salvaged:



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


D9590: copies: extract value comparison in the python copy tracing

2020-12-14 Thread marmoute (Pierre-Yves David)
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This mirror what we did in the Python code. This is useful to prepare rework 
for
  this comparison logic that we will need to handle more advanced chaining cases
  (when merges are chained).

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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
@@ -447,6 +447,12 @@
 return final_copies
 
 
+# constant to decide which side to pick with _merge_copies_dict
+PICK_MINOR = 0
+PICK_MAJOR = 1
+PICK_EITHER = 2
+
+
 def _merge_copies_dict(minor, major, isancestor, changes):
 """merge two copies-mapping together, minor and major
 
@@ -465,36 +471,37 @@
 if other is None:
 minor[dest] = value
 else:
-new_tt = value[0]
-other_tt = other[0]
-if value[1] == other[1]:
-continue
-# content from "major" wins, unless it is older
-# than the branch point or there is a merge
-if new_tt == other_tt:
+pick = _compare_values(changes, isancestor, dest, other, value)
+if pick == PICK_MAJOR:
 minor[dest] = value
-elif (
-changes is not None
-and value[1] is None
-and dest in changes.salvaged
-):
-pass
-elif (
-changes is not None
-and other[1] is None
-and dest in changes.salvaged
-):
-minor[dest] = value
-elif changes is not None and dest in changes.merged:
-minor[dest] = value
-elif not isancestor(new_tt, other_tt):
-if value[1] is not None:
-minor[dest] = value
-elif isancestor(other_tt, new_tt):
-minor[dest] = value
 return minor
 
 
+def _compare_values(changes, isancestor, dest, other, value):
+"""compare two value within a _merge_copies_dict loop iteration"""
+new_tt = value[0]
+other_tt = other[0]
+
+if value[1] == other[1]:
+return PICK_EITHER
+# content from "major" wins, unless it is older
+# than the branch point or there is a merge
+if new_tt == other_tt:
+return PICK_MAJOR
+elif changes is not None and value[1] is None and dest in changes.salvaged:
+return PICK_MINOR
+elif changes is not None and other[1] is None and dest in changes.salvaged:
+return PICK_MAJOR
+elif changes is not None and dest in changes.merged:
+return PICK_MAJOR
+elif not isancestor(new_tt, other_tt):
+if value[1] is not None:
+return PICK_MAJOR
+elif isancestor(other_tt, new_tt):
+return PICK_MAJOR
+return PICK_MINOR
+
+
 def _revinfo_getter_extra(repo):
 """return a function that return multiple data given a "i
 



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


D9591: copies: rename value/other variable to minor/major for clarity

2020-12-14 Thread marmoute (Pierre-Yves David)
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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
@@ -477,27 +477,27 @@
 return minor
 
 
-def _compare_values(changes, isancestor, dest, other, value):
+def _compare_values(changes, isancestor, dest, minor, major):
 """compare two value within a _merge_copies_dict loop iteration"""
-new_tt = value[0]
-other_tt = other[0]
+major_tt = major[0]
+minor_tt = minor[0]
 
-if value[1] == other[1]:
+if major[1] == minor[1]:
 return PICK_EITHER
 # content from "major" wins, unless it is older
 # than the branch point or there is a merge
-if new_tt == other_tt:
+if major_tt == minor_tt:
 return PICK_MAJOR
-elif changes is not None and value[1] is None and dest in changes.salvaged:
+elif changes is not None and major[1] is None and dest in changes.salvaged:
 return PICK_MINOR
-elif changes is not None and other[1] is None and dest in changes.salvaged:
+elif changes is not None and minor[1] is None and dest in changes.salvaged:
 return PICK_MAJOR
 elif changes is not None and dest in changes.merged:
 return PICK_MAJOR
-elif not isancestor(new_tt, other_tt):
-if value[1] is not None:
+elif not isancestor(major_tt, minor_tt):
+if major[1] is not None:
 return PICK_MAJOR
-elif isancestor(other_tt, new_tt):
+elif isancestor(minor_tt, major_tt):
 return PICK_MAJOR
 return PICK_MINOR
 



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


D9589: copies-tests: update to null in test-copies-chain-merge.t

2020-12-14 Thread marmoute (Pierre-Yves David)
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This avoid some unrelated output changeset when adding more cases.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  tests/test-copies-chain-merge.t

CHANGE DETAILS

diff --git a/tests/test-copies-chain-merge.t b/tests/test-copies-chain-merge.t
--- a/tests/test-copies-chain-merge.t
+++ b/tests/test-copies-chain-merge.t
@@ -637,6 +637,8 @@
 Summary of all created cases
 
 
+  $ hg up --quiet null
+
 (This exists to help keeping a compact list of the various cases we have built)
 
   $ hg log -T '{desc|firstline}\n'| sort
@@ -1706,7 +1708,7 @@
 (the copy information from the branch that was not deleted should win).
 
   $ hg log -G --rev 
'::(desc("mCH-delete-before-conflict-m")+desc("mHC-delete-before-conflict-m"))'
-  @36 mHC-delete-before-conflict-m-0
+  o36 mHC-delete-before-conflict-m-0
   |\
   +---o  35 mCH-delete-before-conflict-m-0
   | |/



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


D9588: copies-tests: add a summary of all cases created in test-copies-chain-merge.t

2020-12-14 Thread marmoute (Pierre-Yves David)
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This helps to keep track of existing branch when adding new cases.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  tests/test-copies-chain-merge.t

CHANGE DETAILS

diff --git a/tests/test-copies-chain-merge.t b/tests/test-copies-chain-merge.t
--- a/tests/test-copies-chain-merge.t
+++ b/tests/test-copies-chain-merge.t
@@ -634,6 +634,51 @@
   
 
 
+Summary of all created cases
+
+
+(This exists to help keeping a compact list of the various cases we have built)
+
+  $ hg log -T '{desc|firstline}\n'| sort
+  a-1: d -move-> e
+  a-2: e -move-> f
+  b-1: b update
+  c-1 delete d
+  d-1 delete d
+  d-2 re-add d
+  e-1 b -move-> g
+  e-2 g -move-> f
+  f-1: rename h -> i
+  f-2: rename i -> d
+  g-1: update d
+  h-1: b -(move)-> d
+  i-0 initial commit: a b h
+  i-1: a -move-> c
+  i-2: c -move-> d
+  mABm-0 simple merge - the other way
+  mAEm-0 simple merge - one way
+  mBAm-0 simple merge - one way
+  mBC-revert-m-0
+  mBCm-0 simple merge - one way
+  mBCm-1 re-add d
+  mBDm-0 simple merge - one way
+  mBFm-0 simple merge - one way
+  mCB-revert-m-0
+  mCBm-0 simple merge - the other way
+  mCBm-1 re-add d
+  mCGm-0
+  mCH-delete-before-conflict-m-0
+  mDBm-0 simple merge - the other way
+  mDGm-0 simple merge - one way
+  mEAm-0 simple merge - the other way
+  mFBm-0 simple merge - the other way
+  mFGm-0 simple merge - one way
+  mGCm-0
+  mGDm-0 simple merge - the other way
+  mGFm-0 simple merge - the other way
+  mHC-delete-before-conflict-m-0
+
+
 Test that sidedata computations during upgrades are correct
 ===
 



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


D9587: copies: reinstall initial empty files for chained copied

2020-12-14 Thread marmoute (Pierre-Yves David)
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This effectively back out changeset deeb215be337 
. 
Changeset deeb215be33 
 
does not
  really include a justification for its change and make mes uncomfortable. I 
have
  been thinking about it and they are two options:
  
  - either having empty/full files does not make a difference, and deeb215be337 
 is 
a gratuitous changes.
  
  - either having empty/full files do make a difference and deeb215be33 
 
silently change the test coverage. In such situation if we want the "not empty" 
case to be tested, we should add new cases to cover them
  
  In practice, we know that the "file content did not change, but merge still 
need
  to create a new filenode" case exists (for example if merging result in 
similar
  content but both parent of the file need to be recorded), and that such case 
are
  easy to miss/mess-up in the tests. Having all the file using the same (empty)
  content was done on purpose to increase the coverage of such corner case.
  
  As a result I am reinstalling the previous test situation. If we want to
  increase the coverage of some case involving content-merge in
  test-copies-chain-merge.t, we should add a new, decidated, cases.
  
  Doing so has a large impact on the output of the "copy info in changeset 
extra" variant
  added in 5e72827dae1e 
 (2 
changesets after deeb215be33 
). 
It seems to highlight
  various breakage when merge without content change are involved, this is a 
good
  example of why we want to explicitly test theses cases. Because the different
  -do- matters a lot.
  
  Fixing the "copy info in changeset extra" is not a priority here. because (1)
  this changeset does not break anything, it only highlight that they were 
always
  broken. (2) the only people using "copy info in changeset extra" do not have
  merge.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  tests/test-copies-chain-merge.t

CHANGE DETAILS

diff --git a/tests/test-copies-chain-merge.t b/tests/test-copies-chain-merge.t
--- a/tests/test-copies-chain-merge.t
+++ b/tests/test-copies-chain-merge.t
@@ -50,9 +50,7 @@
 
 Add some linear rename initialy
 
-  $ echo a > a
-  $ echo b > b
-  $ echo h > h
+  $ touch a b h
   $ hg ci -Am 'i-0 initial commit: a b h'
   adding a
   adding b
@@ -302,16 +300,17 @@
 
   $ hg up 'desc("a-2")'
   2 files updated, 0 files merged, 1 files removed, 0 files unresolved
-  $ hg merge 'desc("e-2")' --tool :union
-  merging f
-  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg merge 'desc("e-2")'
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved 
(no-changeset !)
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved 
(changeset !)
   (branch merge, don't forget to commit)
   $ hg ci -m 'mAEm-0 simple merge - one way'
   $ hg up 'desc("e-2")'
-  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  $ hg merge 'desc("a-2")' --tool :union
-  merging f
-  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved 
(no-changeset !)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved 
(changeset !)
+  $ hg merge 'desc("a-2")'
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved 
(no-changeset !)
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved 
(changeset !)
   (branch merge, don't forget to commit)
   $ hg ci -m 'mEAm-0 simple merge - the other way'
   created new head
@@ -349,15 +348,16 @@
   $ hg commit -m "f-2: rename i -> d"
   $ hg debugindex d
  rev linkrev nodeid   p1   p2
-   0   2 169be882533b   (no-changeset !)
-   0   2 b789fdd96dc2   (changeset !)
+   0   2 01c2f5eabdc4   (no-changeset !)
+   0   2 b80de5d13875   (changeset !)
1   8 b004912a8510  
-   2  22 4a067cf8965d   (no-changeset !)
-   2  22 fe6f8b4f507f   (changeset !)
+   2  22 c72365ee036f   (no-changeset !)
   $ hg up 'desc("b-1")'
-  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  3 files updated, 0 files merged, 0 files removed, 

D9585: copies: properly match result during changeset centric copy tracing

2020-12-14 Thread marmoute (Pierre-Yves David)
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  By filtering "during" the iteration we were excluding rename information that
  were not in the matched set but that file served as base information for the
  matched set.
  
  We now do all copy tracing matching at the end of the process to ensure we 
raise
  proper result.
  
  If we were aggregating information top down instead of bottom up we could do
  filtering during processing. However, we don't.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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

CHANGE DETAILS

diff --git a/tests/test-copies-chain-merge.t b/tests/test-copies-chain-merge.t
--- a/tests/test-copies-chain-merge.t
+++ b/tests/test-copies-chain-merge.t
@@ -872,6 +872,19 @@
 Test copy information chaining
 ==
 
+Check that matching only affect the destination and not intermediate path
+-
+
+The two status call should give the same value for f
+
+  $ hg status --copies --rev 'desc("i-0")' --rev 'desc("a-2")'
+  A f
+a
+  R a
+  $ hg status --copies --rev 'desc("i-0")' --rev 'desc("a-2")' f
+  A f
+a (no-changeset no-compatibility !)
+
 merging with unrelated change does not interfere with the renames
 ---
 
diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -196,7 +196,7 @@
 
 alwaysmatch = match.always()
 
-if rustmod is not None and alwaysmatch:
+if rustmod is not None:
 
 def revinfo(rev):
 p1, p2 = parents(rev)
@@ -355,7 +355,7 @@
 
 alwaysmatch = match.always()
 
-if rustmod is not None and alwaysmatch:
+if rustmod is not None:
 final_copies = rustmod.combine_changeset_copies(
 list(revs), children_count, targetrev, revinfo, isancestor
 )
@@ -395,12 +395,6 @@
 elif parent == 2:
 childcopies = changes.copied_from_p2
 
-if not alwaysmatch:
-childcopies = {
-dst: src
-for dst, src in childcopies.items()
-if match(dst)
-}
 if childcopies:
 newcopies = copies.copy()
 for dest, source in pycompat.iteritems(childcopies):
@@ -446,6 +440,10 @@
 for dest, (tt, source) in all_copies[targetrev].items():
 if source is not None:
 final_copies[dest] = source
+if not alwaysmatch:
+for filename in list(final_copies.keys()):
+if not match(filename):
+del final_copies[filename]
 return final_copies
 
 



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


D9586: copies: explain the "arbitrary" copy source pick in case of conflict

2020-12-14 Thread marmoute (Pierre-Yves David)
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  They are a logic and it is easy to explain, so lets explain it.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  tests/test-copies-chain-merge.t

CHANGE DETAILS

diff --git a/tests/test-copies-chain-merge.t b/tests/test-copies-chain-merge.t
--- a/tests/test-copies-chain-merge.t
+++ b/tests/test-copies-chain-merge.t
@@ -1427,11 +1427,6 @@
 This case is similar to BF/FB, but an actual merge happens, so both side of the
 history are relevant.
 
-Note:
-| In this case, the merge get conflicting information since on one side we have
-| "a -> c -> d". and one the other one we have "h -> i -> d".
-|
-| The current code arbitrarily pick one side
 
   $ hg log -G --rev '::(desc("mGFm")+desc("mFGm"))'
   o29 mGFm-0 simple merge - the other way
@@ -1450,6 +1445,33 @@
   |
   o  0 i-0 initial commit: a b h
   
+
+Note:
+| In this case, the merge get conflicting information since on one side we have
+| "a -> c -> d". and one the other one we have "h -> i -> d".
+|
+| The current code arbitrarily pick one side depending the ordering of the 
merged hash:
+
+In this case, the file hash from "f-2" is lower, so it will be `p1` of the 
resulting filenode its copy tracing information will win (and trace back to 
"h"):
+
+Details on this hash ordering pick:
+
+  $ hg manifest --debug 'desc("g-1")' | egrep 'd$'
+  f2b277c39e0d2bbac99d8aae075c0d8b5304d266 644   d (no-changeset !)
+  4ff57b4e8dceedb487e70e6965ea188a7c042cca 644   d (changeset !)
+  $ hg status --copies --rev 'desc("i-0")' --rev 'desc("g-1")' d
+  A d
+a (no-changeset no-compatibility !)
+
+  $ hg manifest --debug 'desc("f-2")' | egrep 'd$'
+  4a067cf8965d1bfff130057ade26b44f580231be 644   d (no-changeset !)
+  fe6f8b4f507fe3eb524c527192a84920a4288dac 644   d (changeset !)
+  $ hg status --copies --rev 'desc("i-0")' --rev 'desc("f-2")' d
+  A d
+h (no-changeset no-compatibility !)
+
+Copy tracing data on the resulting merge:
+
   $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mFGm-0")'
   A d
 h



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


D9584: copies: avoid early return in _combine_changeset_copies

2020-12-14 Thread marmoute (Pierre-Yves David)
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  We have to change how we deal with matching (see next changeset) and that
  processing is common. So we shuffle things around before doing the semantic
  change for clarity.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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
@@ -356,98 +356,96 @@
 alwaysmatch = match.always()
 
 if rustmod is not None and alwaysmatch:
-return rustmod.combine_changeset_copies(
+final_copies = rustmod.combine_changeset_copies(
 list(revs), children_count, targetrev, revinfo, isancestor
 )
-
-isancestor = cached_is_ancestor(isancestor)
-
-all_copies = {}
-# iterate over all the "children" side of copy tracing "edge"
-for current_rev in revs:
-p1, p2, changes = revinfo(current_rev)
-current_copies = None
+else:
+isancestor = cached_is_ancestor(isancestor)
 
-# iterate over all parents to chain the existing data with the
-# data from the parent → child edge.
-for parent, parent_rev in ((1, p1), (2, p2)):
-if parent_rev == node.nullrev:
-continue
-remaining_children = children_count.get(parent_rev)
-if remaining_children is None:
-continue
-remaining_children -= 1
-children_count[parent_rev] = remaining_children
-if remaining_children:
-copies = all_copies.get(parent_rev, None)
-else:
-copies = all_copies.pop(parent_rev, None)
+all_copies = {}
+# iterate over all the "children" side of copy tracing "edge"
+for current_rev in revs:
+p1, p2, changes = revinfo(current_rev)
+current_copies = None
+# iterate over all parents to chain the existing data with the
+# data from the parent → child edge.
+for parent, parent_rev in ((1, p1), (2, p2)):
+if parent_rev == node.nullrev:
+continue
+remaining_children = children_count.get(parent_rev)
+if remaining_children is None:
+continue
+remaining_children -= 1
+children_count[parent_rev] = remaining_children
+if remaining_children:
+copies = all_copies.get(parent_rev, None)
+else:
+copies = all_copies.pop(parent_rev, None)
 
-if copies is None:
-# this is a root
-copies = {}
+if copies is None:
+# this is a root
+copies = {}
 
-newcopies = copies
-# chain the data in the edge with the existing data
-if changes is not None:
-childcopies = {}
-if parent == 1:
-childcopies = changes.copied_from_p1
-elif parent == 2:
-childcopies = changes.copied_from_p2
+newcopies = copies
+# chain the data in the edge with the existing data
+if changes is not None:
+childcopies = {}
+if parent == 1:
+childcopies = changes.copied_from_p1
+elif parent == 2:
+childcopies = changes.copied_from_p2
 
-if not alwaysmatch:
-childcopies = {
-dst: src
-for dst, src in childcopies.items()
-if match(dst)
-}
-if childcopies:
-newcopies = copies.copy()
-for dest, source in pycompat.iteritems(childcopies):
-prev = copies.get(source)
-if prev is not None and prev[1] is not None:
-source = prev[1]
-newcopies[dest] = (current_rev, source)
-assert newcopies is not copies
-if changes.removed:
-if newcopies is copies:
+if not alwaysmatch:
+childcopies = {
+dst: src
+for dst, src in childcopies.items()
+if match(dst)
+}
+if childcopies:
 newcopies = copies.copy()
-for f in changes.removed:
-if f in newcopies:
-if newcopies is copies:
-# copy on write to avoid 

D9583: upgrade: add a missing space in status message

2020-12-14 Thread pulkit (Pulkit Goyal)
pulkit created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Found while reading the code to refactor.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/upgrade.py
  tests/test-upgrade-repo.t

CHANGE DETAILS

diff --git a/tests/test-upgrade-repo.t b/tests/test-upgrade-repo.t
--- a/tests/test-upgrade-repo.t
+++ b/tests/test-upgrade-repo.t
@@ -659,7 +659,7 @@
   replacing store...
   store replacement complete; repository was inconsistent for * (glob)
   finalizing requirements file and making repository readable again
-  removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
+  removing old repository content $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
   removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
   $ ls -1 .hg/ | grep upgradebackup
   [1]
@@ -706,7 +706,7 @@
   replacing store...
   store replacement complete; repository was inconsistent for *s (glob)
   finalizing requirements file and making repository readable again
-  removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
+  removing old repository content $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
   removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
 
 Check that the repo still works fine
@@ -786,7 +786,7 @@
   replacing store...
   store replacement complete; repository was inconsistent for *s (glob)
   finalizing requirements file and making repository readable again
-  removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
+  removing old repository content $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
   removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
   $ hg verify
   checking changesets
@@ -837,7 +837,7 @@
   replacing store...
   store replacement complete; repository was inconsistent for *s (glob)
   finalizing requirements file and making repository readable again
-  removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
+  removing old repository content $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
   removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
   $ hg verify
   checking changesets
@@ -888,7 +888,7 @@
   replacing store...
   store replacement complete; repository was inconsistent for *s (glob)
   finalizing requirements file and making repository readable again
-  removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
+  removing old repository content $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
   removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
   $ hg verify
   checking changesets
@@ -946,7 +946,7 @@
   replacing store...
   store replacement complete; repository was inconsistent for *s (glob)
   finalizing requirements file and making repository readable again
-  removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
+  removing old repository content $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
   removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
   $ hg verify
   checking changesets
@@ -1005,7 +1005,7 @@
   replacing store...
   store replacement complete; repository was inconsistent for *s (glob)
   finalizing requirements file and making repository readable again
-  removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
+  removing old repository content $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
   removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
   $ hg verify
   checking changesets
diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py
--- a/mercurial/upgrade.py
+++ b/mercurial/upgrade.py
@@ -228,7 +228,7 @@
 )
 if not (backup or backuppath is None):
 ui.status(
-_(b'removing old repository content%s\n') % backuppath
+_(b'removing old repository content %s\n') % backuppath
 )
 repo.vfs.rmtree(backuppath, forcibly=True)
 backuppath = None



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


D9582: upgrade: rename deficiences to format_upgrades

2020-12-14 Thread pulkit (Pulkit Goyal)
pulkit created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  It was not obvious what does deficieny means and every format upgrade can't 
be a
  deficiency. There are some format upgrades like compression levels, share-safe
  which can't be understood at deficiencies.
  
  This patch renames to make it more clearer. The ui message also improved
  which is a good thing.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/upgrade.py
  mercurial/upgrade_utils/actions.py
  tests/test-upgrade-repo.t

CHANGE DETAILS

diff --git a/tests/test-upgrade-repo.t b/tests/test-upgrade-repo.t
--- a/tests/test-upgrade-repo.t
+++ b/tests/test-upgrade-repo.t
@@ -173,7 +173,7 @@
}
   ]
   $ hg debugupgraderepo
-  (no feature deficiencies found in existing repository)
+  (no format upgrades found in existing repository)
   performing an upgrade with "--run" will make the following changes:
   
   requirements
@@ -212,7 +212,7 @@
 --optimize can be used to add optimizations
 
   $ hg debugupgrade --optimize redeltaparent
-  (no feature deficiencies found in existing repository)
+  (no format upgrades found in existing repository)
   performing an upgrade with "--run" will make the following changes:
   
   requirements
@@ -243,7 +243,7 @@
 modern form of the option
 
   $ hg debugupgrade --optimize re-delta-parent
-  (no feature deficiencies found in existing repository)
+  (no format upgrades found in existing repository)
   performing an upgrade with "--run" will make the following changes:
   
   requirements
diff --git a/mercurial/upgrade_utils/actions.py 
b/mercurial/upgrade_utils/actions.py
--- a/mercurial/upgrade_utils/actions.py
+++ b/mercurial/upgrade_utils/actions.py
@@ -28,7 +28,7 @@
 return set()
 
 
-DEFICIENCY = b'deficiency'
+FORMAT_UPGRADE = b'deficiency'
 OPTIMISATION = b'optimization'
 
 
@@ -42,13 +42,15 @@
will be mapped to an action later in the upgrade process.
 
 type
-   Either ``DEFICIENCY`` or ``OPTIMISATION``. A deficiency is an obvious
-   problem. An optimization is an action (sometimes optional) that
+   Either ``FORMAT_UPGRADE`` or ``OPTIMISATION``.
+   A format upgrade is where we can upgrade the storage format. Not
+   all storage formats upgrades are deficiencies.
+   An optimization is an action (sometimes optional) that
can be taken to further improve the state of the repository.
 
 description
Message intended for humans explaining the improvement in more detail,
-   including the implications of it. For ``DEFICIENCY`` types, should be
+   including the implications of it. For ``FORMAT_UPGRADE`` types, should 
be
worded in the present tense. For ``OPTIMISATION`` types, should be
worded in the future tense.
 
@@ -87,7 +89,7 @@
 class formatvariant(improvement):
 """an improvement subclass dedicated to repository format"""
 
-type = DEFICIENCY
+type = FORMAT_UPGRADE
 ### The following attributes should be defined for each class:
 
 # machine-readable string uniquely identifying this improvement. it will be
@@ -95,7 +97,8 @@
 name = None
 
 # message intended for humans explaining the improvement in more detail,
-# including the implications of it ``DEFICIENCY`` types, should be worded
+# including the implications of it ``FORMAT_UPGRADE`` types, should be
+# worded
 # in the present tense.
 description = None
 
@@ -410,9 +413,9 @@
 return bytes(level)
 
 
-def finddeficiencies(repo):
-"""returns a list of deficiencies that the repo suffer from"""
-deficiencies = []
+def find_format_upgrades(repo):
+"""returns a list of format upgrades which can be perform on the repo"""
+upgrades = []
 
 # We could detect lack of revlogv1 and store here, but they were added
 # in 0.9.2 and we don't support upgrading repos without these
@@ -420,9 +423,9 @@
 
 for fv in allformatvariant:
 if not fv.fromrepo(repo):
-deficiencies.append(fv)
+upgrades.append(fv)
 
-return deficiencies
+return upgrades
 
 
 ALL_OPTIMISATIONS = []
@@ -523,10 +526,10 @@
 return list(ALL_OPTIMISATIONS)
 
 
-def determineactions(repo, deficiencies, sourcereqs, destreqs):
+def determineactions(repo, format_upgrades, sourcereqs, destreqs):
 """Determine upgrade actions that will be performed.
 
-Given a list of improvements as returned by ``finddeficiencies`` and
+Given a list of improvements as returned by ``find_format_upgrades`` and
 ``findoptimizations``, determine the list of upgrade actions that
 will be performed.
 
@@ -538,7 +541,7 @@
 """
 newactions = []
 
-for d in deficiencies:
+for d in format_upgrades:
 name = d._requirement
 
 # If the action is a requirement that doesn't show up in the
diff --git 

D9581: copies: document the current algorithm step

2020-12-14 Thread marmoute (Pierre-Yves David)
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  We are about to reorganise everything and we document the "old" way to clarify
  the change that leads to the "new way".

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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
@@ -349,14 +349,21 @@
 isancestor = cached_is_ancestor(isancestor)
 
 all_copies = {}
+# iterate over all the "parent" side of copy tracing "edge"
 for r in revs:
+# fetch potential previously computed data for that parent
 copies = all_copies.pop(r, None)
 if copies is None:
 # this is a root
 copies = {}
+
+# iterate over all known children to chain the existing data with the
+# data from the parent → child edge.
 for i, c in enumerate(children[r]):
 p1, p2, changes = revinfo(c)
 childcopies = {}
+
+# select the right parent → child edge
 if r == p1:
 parent = 1
 if changes is not None:
@@ -370,6 +377,8 @@
 childcopies = {
 dst: src for dst, src in childcopies.items() if match(dst)
 }
+
+# chain the data in the edge with the existing data
 newcopies = copies
 if childcopies:
 newcopies = copies.copy()
@@ -390,6 +399,9 @@
 # could be avoided.
 newcopies = copies.copy()
 newcopies[f] = (c, None)
+
+# check potential need to combine the data from another parent (for
+# that child). See comment below for details.
 othercopies = all_copies.get(c)
 if othercopies is None:
 all_copies[c] = newcopies
@@ -416,6 +428,7 @@
 copies = _merge_copies_dict(minor, major, isancestor, changes)
 all_copies[c] = copies
 
+# filter out internal details and return a {dest: source mapping}
 final_copies = {}
 for dest, (tt, source) in all_copies[targetrev].items():
 if source is not None:



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


D9580: engine: unwrap a hard to understand for loop

2020-12-14 Thread pulkit (Pulkit Goyal)
pulkit created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  The loop was iterating over all the datafiles and maintaining a set to check
  whether filelogs have been processed, manifests have been processed or not.
  
  The code was hard to understand and it assumed that `alldatafiles` are ordered
  in a certain way.
  
  This refactors the for loop in separate parts for each manifests, changelog 
and
  filelogs. This will also help in future work where we will like more better
  handling on whether we want to upgrade filelogs or not.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/upgrade_utils/engine.py

CHANGE DETAILS

diff --git a/mercurial/upgrade_utils/engine.py 
b/mercurial/upgrade_utils/engine.py
--- a/mercurial/upgrade_utils/engine.py
+++ b/mercurial/upgrade_utils/engine.py
@@ -148,6 +148,12 @@
 cdstsize = 0
 
 alldatafiles = list(srcrepo.store.walk())
+# mapping of data files which needs to be cloned
+# key is unencoded filename
+# value is revlog_object_from_srcrepo
+manifests = {}
+changelogs = {}
+filelogs = {}
 
 # Perform a pass to collect metadata. This validates we can open all
 # source files and allows a unified progress bar to be displayed.
@@ -173,15 +179,18 @@
 
 # This is for the separate progress bars.
 if isinstance(rl, changelog.changelog):
+changelogs[unencoded] = rl
 crevcount += len(rl)
 csrcsize += datasize
 crawsize += rawsize
 elif isinstance(rl, manifest.manifestrevlog):
+manifests[unencoded] = rl
 mcount += 1
 mrevcount += len(rl)
 msrcsize += datasize
 mrawsize += rawsize
 elif isinstance(rl, filelog.filelog):
+filelogs[unencoded] = rl
 fcount += 1
 frevcount += len(rl)
 fsrcsize += datasize
@@ -240,101 +249,90 @@
 newrl = _revlogfrompath(dstrepo, unencoded)
 return newrl
 
-# Do the actual copying.
-# FUTURE this operation can be farmed off to worker processes.
-seen = set()
-for unencoded, encoded, size in alldatafiles:
-if unencoded.endswith(b'.d'):
-continue
-
-oldrl = _revlogfrompath(srcrepo, unencoded)
-
-if isinstance(oldrl, changelog.changelog) and b'c' not in seen:
-ui.status(
-_(
-b'finished migrating %d manifest revisions across %d '
-b'manifests; change in size: %s\n'
-)
-% (mrevcount, mcount, util.bytecount(mdstsize - msrcsize))
-)
-
-ui.status(
-_(
-b'migrating changelog containing %d revisions '
-b'(%s in store; %s tracked data)\n'
-)
-% (
-crevcount,
-util.bytecount(csrcsize),
-util.bytecount(crawsize),
-)
-)
-seen.add(b'c')
-progress = srcrepo.ui.makeprogress(
-_(b'changelog revisions'), total=crevcount
-)
-elif isinstance(oldrl, manifest.manifestrevlog) and b'm' not in seen:
-ui.status(
-_(
-b'finished migrating %d filelog revisions across %d '
-b'filelogs; change in size: %s\n'
-)
-% (frevcount, fcount, util.bytecount(fdstsize - fsrcsize))
-)
-
-ui.status(
-_(
-b'migrating %d manifests containing %d revisions '
-b'(%s in store; %s tracked data)\n'
-)
-% (
-mcount,
-mrevcount,
-util.bytecount(msrcsize),
-util.bytecount(mrawsize),
-)
-)
-seen.add(b'm')
-if progress:
-progress.complete()
-progress = srcrepo.ui.makeprogress(
-_(b'manifest revisions'), total=mrevcount
-)
-elif b'f' not in seen:
-ui.status(
-_(
-b'migrating %d filelogs containing %d revisions '
-b'(%s in store; %s tracked data)\n'
-)
-% (
-fcount,
-frevcount,
-util.bytecount(fsrcsize),
-util.bytecount(frawsize),
-)
-)
-seen.add(b'f')
-if progress:
-progress.complete()
-progress = srcrepo.ui.makeprogress(
-_(b'file revisions'), total=frevcount
-)
-
+# Migrating filelogs
+ui.status(
+_(
+   

D9579: engine: refactor actual cloning code into separate function

2020-12-14 Thread pulkit (Pulkit Goyal)
pulkit created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  The `for ...` under which this cloning code exists is too complicated and 
based
  on certain assumptions. I am going to refactor it in next patches and make it
  bit saner.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/upgrade_utils/engine.py

CHANGE DETAILS

diff --git a/mercurial/upgrade_utils/engine.py 
b/mercurial/upgrade_utils/engine.py
--- a/mercurial/upgrade_utils/engine.py
+++ b/mercurial/upgrade_utils/engine.py
@@ -212,6 +212,34 @@
 
 sidedatacompanion = getsidedatacompanion(srcrepo, dstrepo)
 
+def _perform_clone(
+old_revlog,
+unencoded,
+):
+""" returns the new revlog object created"""
+newrl = None
+if matchrevlog(revlogs, unencoded):
+ui.note(
+_(b'cloning %d revisions from %s\n')
+% (len(old_revlog), unencoded)
+)
+newrl = _revlogfrompath(dstrepo, unencoded)
+oldrl.clone(
+tr,
+newrl,
+addrevisioncb=oncopiedrevision,
+deltareuse=deltareuse,
+forcedeltabothparents=forcedeltabothparents,
+sidedatacompanion=sidedatacompanion,
+)
+else:
+msg = _(b'blindly copying %s containing %i revisions\n')
+ui.note(msg % (unencoded, len(old_revlog)))
+_copyrevlog(tr, dstrepo, old_revlog, unencoded)
+
+newrl = _revlogfrompath(dstrepo, unencoded)
+return newrl
+
 # Do the actual copying.
 # FUTURE this operation can be farmed off to worker processes.
 seen = set()
@@ -292,26 +320,7 @@
 _(b'file revisions'), total=frevcount
 )
 
-if matchrevlog(revlogs, unencoded):
-ui.note(
-_(b'cloning %d revisions from %s\n') % (len(oldrl), unencoded)
-)
-newrl = _revlogfrompath(dstrepo, unencoded)
-oldrl.clone(
-tr,
-newrl,
-addrevisioncb=oncopiedrevision,
-deltareuse=deltareuse,
-forcedeltabothparents=forcedeltabothparents,
-sidedatacompanion=sidedatacompanion,
-)
-else:
-msg = _(b'blindly copying %s containing %i revisions\n')
-ui.note(msg % (unencoded, len(oldrl)))
-_copyrevlog(tr, dstrepo, oldrl, unencoded)
-
-newrl = _revlogfrompath(dstrepo, unencoded)
-
+newrl = _perform_clone(oldrl, unencoded)
 info = newrl.storageinfo(storedsize=True)
 datasize = info[b'storedsize'] or 0
 



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


D9578: upgrade: move printing of unused optimizations to UpgradeOperation class

2020-12-14 Thread pulkit (Pulkit Goyal)
pulkit created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/upgrade.py
  mercurial/upgrade_utils/actions.py

CHANGE DETAILS

diff --git a/mercurial/upgrade_utils/actions.py 
b/mercurial/upgrade_utils/actions.py
--- a/mercurial/upgrade_utils/actions.py
+++ b/mercurial/upgrade_utils/actions.py
@@ -563,6 +563,7 @@
 new_requirements,
 current_requirements,
 actions,
+all_optimizations,
 revlogs_to_process,
 ):
 self.ui = ui
@@ -583,6 +584,12 @@
 self.preserved_requirements = (
 self.current_requirements & self.new_requirements
 )
+self.all_optimizations = all_optimizations
+# optimizations which are not used and it's recommended that they
+# should use them
+self.unused_optimizations = [
+i for i in all_optimizations if i not in self.actions
+]
 
 def _write_labeled(self, l, label):
 """
@@ -640,6 +647,10 @@
 self.ui.write((b'  - %s\n' % r))
 self.ui.write((b'\n'))
 
+def print_unused_optimizations(self):
+for i in self.unused_optimizations:
+self.ui.status(_(b'%s\n   %s\n\n') % (i.name, i.description))
+
 def has_action(self, name):
 """ Check whether the upgrade operation will perform this action """
 return name in self._actions_names
diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py
--- a/mercurial/upgrade.py
+++ b/mercurial/upgrade.py
@@ -128,6 +128,7 @@
 newreqs,
 repo.requirements,
 actions,
+alloptimizations,
 revlogs,
 )
 
@@ -184,17 +185,14 @@
 upgrade_op.print_upgrade_actions()
 upgrade_op.print_affected_revlogs()
 
-unusedoptimize = [i for i in alloptimizations if i not in actions]
-
-if unusedoptimize:
+if upgrade_op.unused_optimizations:
 ui.status(
 _(
 b'additional optimizations are available by specifying '
 b'"--optimize ":\n\n'
 )
 )
-for i in unusedoptimize:
-ui.status(_(b'%s\n   %s\n\n') % (i.name, i.description))
+upgrade_op.print_unused_optimizations()
 return
 
 # Else we're in the run=true case.



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


D9577: upgrade: move `printrequirements()` to UpgradeOperation class

2020-12-14 Thread pulkit (Pulkit Goyal)
pulkit created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Part of refactor where we make things more arranged and integrated into single
  `UpgradeOperation` class.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/upgrade.py
  mercurial/upgrade_utils/actions.py
  mercurial/upgrade_utils/engine.py

CHANGE DETAILS

diff --git a/mercurial/upgrade_utils/engine.py 
b/mercurial/upgrade_utils/engine.py
--- a/mercurial/upgrade_utils/engine.py
+++ b/mercurial/upgrade_utils/engine.py
@@ -429,7 +429,7 @@
 # The sorted() makes execution deterministic.
 for p, kind, st in sorted(srcrepo.store.vfs.readdir(b'', stat=True)):
 if not _filterstorefile(
-srcrepo, dstrepo, upgrade_op.requirements, p, kind, st
+srcrepo, dstrepo, upgrade_op.new_requirements, p, kind, st
 ):
 continue
 
@@ -489,7 +489,7 @@
 b'again\n'
 )
 )
-scmutil.writereporequirements(srcrepo, upgrade_op.requirements)
+scmutil.writereporequirements(srcrepo, upgrade_op.new_requirements)
 
 # The lock file from the old store won't be removed because nothing has a
 # reference to its new location. So clean it up manually. Alternatively, we
diff --git a/mercurial/upgrade_utils/actions.py 
b/mercurial/upgrade_utils/actions.py
--- a/mercurial/upgrade_utils/actions.py
+++ b/mercurial/upgrade_utils/actions.py
@@ -557,12 +557,32 @@
 class UpgradeOperation(object):
 """represent the work to be done during an upgrade"""
 
-def __init__(self, ui, requirements, actions, revlogs_to_process):
+def __init__(
+self,
+ui,
+new_requirements,
+current_requirements,
+actions,
+revlogs_to_process,
+):
 self.ui = ui
-self.requirements = requirements
+self.new_requirements = new_requirements
+self.current_requirements = current_requirements
 self.actions = actions
 self._actions_names = set([a.name for a in actions])
 self.revlogs_to_process = revlogs_to_process
+# requirements which will be added by the operation
+self.added_requirements = (
+self.new_requirements - self.current_requirements
+)
+# requirements which will be removed by the operation
+self.removed_requirements = (
+self.current_requirements - self.new_requirements
+)
+# requirements which will be preserved by the operation
+self.preserved_requirements = (
+self.current_requirements & self.new_requirements
+)
 
 def _write_labeled(self, l, label):
 """
@@ -575,6 +595,27 @@
 self.ui.write(r, label=label)
 first = False
 
+def print_requirements(self):
+self.ui.write(_(b'requirements\n'))
+self.ui.write(_(b'   preserved: '))
+self._write_labeled(
+self.preserved_requirements, "upgrade-repo.requirement.preserved"
+)
+self.ui.write((b'\n'))
+if self.removed_requirements:
+self.ui.write(_(b'   removed: '))
+self._write_labeled(
+self.removed_requirements, "upgrade-repo.requirement.removed"
+)
+self.ui.write((b'\n'))
+if self.added_requirements:
+self.ui.write(_(b'   added: '))
+self._write_labeled(
+self.added_requirements, "upgrade-repo.requirement.added"
+)
+self.ui.write((b'\n'))
+self.ui.write(b'\n')
+
 def print_optimisations(self):
 optimisations = [a for a in self.actions if a.type == OPTIMISATION]
 optimisations.sort(key=lambda a: a.name)
diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py
--- a/mercurial/upgrade.py
+++ b/mercurial/upgrade.py
@@ -123,36 +123,10 @@
 ui.warn(msg % b', '.join(sorted(incompatible)))
 revlogs = upgrade_engine.UPGRADE_ALL_REVLOGS
 
-def write_labeled(l, label):
-first = True
-for r in sorted(l):
-if not first:
-ui.write(b', ')
-ui.write(r, label=label)
-first = False
-
-def printrequirements():
-ui.write(_(b'requirements\n'))
-ui.write(_(b'   preserved: '))
-write_labeled(
-newreqs & repo.requirements, "upgrade-repo.requirement.preserved"
-)
-ui.write((b'\n'))
-removed = repo.requirements - newreqs
-if repo.requirements - newreqs:
-ui.write(_(b'   removed: '))
-write_labeled(removed, "upgrade-repo.requirement.removed")
-ui.write((b'\n'))
-added = newreqs - repo.requirements
-if added:
-ui.write(_(b'   added: '))
-write_labeled(added, "upgrade-repo.requirement.added")
-ui.write((b'\n'))
-

D9576: upgrade: move `printoptimisations() to UpgradeOperation class

2020-12-14 Thread pulkit (Pulkit Goyal)
pulkit created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Part of refactor where we make things more arranged and integrated into single
  `UpgradeOperation` class.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/upgrade.py
  mercurial/upgrade_utils/actions.py

CHANGE DETAILS

diff --git a/mercurial/upgrade_utils/actions.py 
b/mercurial/upgrade_utils/actions.py
--- a/mercurial/upgrade_utils/actions.py
+++ b/mercurial/upgrade_utils/actions.py
@@ -564,6 +564,28 @@
 self._actions_names = set([a.name for a in actions])
 self.revlogs_to_process = revlogs_to_process
 
+def _write_labeled(self, l, label):
+"""
+Utility function to aid writing of a list under one label
+"""
+first = True
+for r in sorted(l):
+if not first:
+self.ui.write(b', ')
+self.ui.write(r, label=label)
+first = False
+
+def print_optimisations(self):
+optimisations = [a for a in self.actions if a.type == OPTIMISATION]
+optimisations.sort(key=lambda a: a.name)
+if optimisations:
+self.ui.write(_(b'optimisations: '))
+self._write_labeled(
+[a.name for a in optimisations],
+"upgrade-repo.optimisation.performed",
+)
+self.ui.write(b'\n\n')
+
 def print_upgrade_actions(self):
 for a in self.actions:
 self.ui.status(b'%s\n   %s\n\n' % (a.name, a.upgrademessage))
diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py
--- a/mercurial/upgrade.py
+++ b/mercurial/upgrade.py
@@ -150,19 +150,6 @@
 ui.write((b'\n'))
 ui.write(b'\n')
 
-def printoptimisations():
-optimisations = [
-a for a in actions if a.type == upgrade_actions.OPTIMISATION
-]
-optimisations.sort(key=lambda a: a.name)
-if optimisations:
-ui.write(_(b'optimisations: '))
-write_labeled(
-[a.name for a in optimisations],
-"upgrade-repo.optimisation.performed",
-)
-ui.write(b'\n\n')
-
 upgrade_op = upgrade_actions.UpgradeOperation(
 ui,
 newreqs,
@@ -219,7 +206,7 @@
 )
 
 printrequirements()
-printoptimisations()
+upgrade_op.print_optimisations()
 upgrade_op.print_upgrade_actions()
 upgrade_op.print_affected_revlogs()
 
@@ -239,7 +226,7 @@
 # Else we're in the run=true case.
 ui.write(_(b'upgrade will perform the following actions:\n\n'))
 printrequirements()
-printoptimisations()
+upgrade_op.print_optimisations()
 upgrade_op.print_upgrade_actions()
 upgrade_op.print_affected_revlogs()
 



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


D9575: upgrade: move `printupgradeactions()` to UpgradeOperation class

2020-12-14 Thread pulkit (Pulkit Goyal)
pulkit created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Part of refactor where we make things more arranged and integrated into single
  `UpgradeOperation` class.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/upgrade.py
  mercurial/upgrade_utils/actions.py
  mercurial/upgrade_utils/engine.py

CHANGE DETAILS

diff --git a/mercurial/upgrade_utils/engine.py 
b/mercurial/upgrade_utils/engine.py
--- a/mercurial/upgrade_utils/engine.py
+++ b/mercurial/upgrade_utils/engine.py
@@ -403,13 +403,13 @@
 )
 )
 
-if b're-delta-all' in upgrade_op.actions:
+if upgrade_op.has_action(b're-delta-all'):
 deltareuse = revlog.revlog.DELTAREUSENEVER
-elif b're-delta-parent' in upgrade_op.actions:
+elif upgrade_op.has_action(b're-delta-parent'):
 deltareuse = revlog.revlog.DELTAREUSESAMEREVS
-elif b're-delta-multibase' in upgrade_op.actions:
+elif upgrade_op.has_action(b're-delta-multibase'):
 deltareuse = revlog.revlog.DELTAREUSESAMEREVS
-elif b're-delta-fulladd' in upgrade_op.actions:
+elif upgrade_op.has_action(b're-delta-fulladd'):
 deltareuse = revlog.revlog.DELTAREUSEFULLADD
 else:
 deltareuse = revlog.revlog.DELTAREUSEALWAYS
@@ -421,7 +421,7 @@
 dstrepo,
 tr,
 deltareuse,
-b're-delta-multibase' in upgrade_op.actions,
+upgrade_op.has_action(b're-delta-multibase'),
 revlogs=upgrade_op.revlogs_to_process,
 )
 
diff --git a/mercurial/upgrade_utils/actions.py 
b/mercurial/upgrade_utils/actions.py
--- a/mercurial/upgrade_utils/actions.py
+++ b/mercurial/upgrade_utils/actions.py
@@ -561,8 +561,13 @@
 self.ui = ui
 self.requirements = requirements
 self.actions = actions
+self._actions_names = set([a.name for a in actions])
 self.revlogs_to_process = revlogs_to_process
 
+def print_upgrade_actions(self):
+for a in self.actions:
+self.ui.status(b'%s\n   %s\n\n' % (a.name, a.upgrademessage))
+
 def print_affected_revlogs(self):
 if not self.revlogs_to_process:
 self.ui.write((b'no revlogs to process\n'))
@@ -572,6 +577,10 @@
 self.ui.write((b'  - %s\n' % r))
 self.ui.write((b'\n'))
 
+def has_action(self, name):
+""" Check whether the upgrade operation will perform this action """
+return name in self._actions_names
+
 
 ###  Code checking if a repository can got through the upgrade process at all. 
#
 
diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py
--- a/mercurial/upgrade.py
+++ b/mercurial/upgrade.py
@@ -163,14 +163,10 @@
 )
 ui.write(b'\n\n')
 
-def printupgradeactions():
-for a in actions:
-ui.status(b'%s\n   %s\n\n' % (a.name, a.upgrademessage))
-
 upgrade_op = upgrade_actions.UpgradeOperation(
 ui,
 newreqs,
-[a.name for a in actions],
+actions,
 revlogs,
 )
 
@@ -224,7 +220,7 @@
 
 printrequirements()
 printoptimisations()
-printupgradeactions()
+upgrade_op.print_upgrade_actions()
 upgrade_op.print_affected_revlogs()
 
 unusedoptimize = [i for i in alloptimizations if i not in actions]
@@ -244,7 +240,7 @@
 ui.write(_(b'upgrade will perform the following actions:\n\n'))
 printrequirements()
 printoptimisations()
-printupgradeactions()
+upgrade_op.print_upgrade_actions()
 upgrade_op.print_affected_revlogs()
 
 ui.status(_(b'beginning upgrade...\n'))



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


D9574: upgrade: move `print_affected_revlogs()` to UpgradeOperation class

2020-12-14 Thread pulkit (Pulkit Goyal)
pulkit created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Part of refactor where we make things more arranged and integrated into single
  `UpgradeOperation` class.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/upgrade.py
  mercurial/upgrade_utils/actions.py

CHANGE DETAILS

diff --git a/mercurial/upgrade_utils/actions.py 
b/mercurial/upgrade_utils/actions.py
--- a/mercurial/upgrade_utils/actions.py
+++ b/mercurial/upgrade_utils/actions.py
@@ -557,11 +557,21 @@
 class UpgradeOperation(object):
 """represent the work to be done during an upgrade"""
 
-def __init__(self, requirements, actions, revlogs_to_process):
+def __init__(self, ui, requirements, actions, revlogs_to_process):
+self.ui = ui
 self.requirements = requirements
 self.actions = actions
 self.revlogs_to_process = revlogs_to_process
 
+def print_affected_revlogs(self):
+if not self.revlogs_to_process:
+self.ui.write((b'no revlogs to process\n'))
+else:
+self.ui.write((b'processed revlogs:\n'))
+for r in sorted(self.revlogs_to_process):
+self.ui.write((b'  - %s\n' % r))
+self.ui.write((b'\n'))
+
 
 ###  Code checking if a repository can got through the upgrade process at all. 
#
 
diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py
--- a/mercurial/upgrade.py
+++ b/mercurial/upgrade.py
@@ -167,16 +167,8 @@
 for a in actions:
 ui.status(b'%s\n   %s\n\n' % (a.name, a.upgrademessage))
 
-def print_affected_revlogs():
-if not revlogs:
-ui.write((b'no revlogs to process\n'))
-else:
-ui.write((b'processed revlogs:\n'))
-for r in sorted(revlogs):
-ui.write((b'  - %s\n' % r))
-ui.write((b'\n'))
-
 upgrade_op = upgrade_actions.UpgradeOperation(
+ui,
 newreqs,
 [a.name for a in actions],
 revlogs,
@@ -233,7 +225,7 @@
 printrequirements()
 printoptimisations()
 printupgradeactions()
-print_affected_revlogs()
+upgrade_op.print_affected_revlogs()
 
 unusedoptimize = [i for i in alloptimizations if i not in actions]
 
@@ -253,7 +245,7 @@
 printrequirements()
 printoptimisations()
 printupgradeactions()
-print_affected_revlogs()
+upgrade_op.print_affected_revlogs()
 
 ui.status(_(b'beginning upgrade...\n'))
 with repo.wlock(), repo.lock():



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


mercurial@46107: 5 new changesets

2020-12-14 Thread Mercurial Commits
5 new changesets in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/3f82a915ab2a
changeset:   46103:3f82a915ab2a
user:Augie Fackler 
date:Thu Dec 10 11:42:49 2020 -0500
summary: histedit: tweak `edit` message to try and guide users to our 
workflow

https://www.mercurial-scm.org/repo/hg/rev/6f8a94bbfba1
changeset:   46104:6f8a94bbfba1
user:Augie Fackler 
date:Thu Dec 10 13:15:15 2020 -0500
summary: histedit: adjust comment describing `edit` action for clarity

https://www.mercurial-scm.org/repo/hg/rev/ed5a0b5d21a6
changeset:   46105:ed5a0b5d21a6
user:Martin von Zweigbergk 
date:Thu Dec 10 12:00:45 2020 -0800
summary: diff: describe behavior by using --from/--to instead of varying 
revision count

https://www.mercurial-scm.org/repo/hg/rev/4a0730b7127e
changeset:   46106:4a0730b7127e
user:Martin von Zweigbergk 
date:Thu Dec 10 12:06:55 2020 -0800
summary: diff: update synopsis to use --from/--to instead of -r

https://www.mercurial-scm.org/repo/hg/rev/aa4dbc14f735
changeset:   46107:aa4dbc14f735
bookmark:@
tag: tip
user:Martin von Zweigbergk 
date:Thu Dec 10 14:39:22 2020 -0800
summary: diff: deprecate -r option

-- 
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