changeset 5600:d77d61c9e5e9

branching: merge with stable
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 15 Oct 2020 19:46:38 +0200
parents ba8bc1b0acd2 (current diff) d1f6cf85bfec (diff)
children 3946ee4ee3ae
files CHANGELOG README.rst hgext3rd/evolve/cmdrewrite.py hgext3rd/evolve/compat.py tests/test-evolve-progress.t
diffstat 5 files changed, 37 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGELOG	Sun Oct 11 20:50:02 2020 +0800
+++ b/CHANGELOG	Thu Oct 15 19:46:38 2020 +0200
@@ -21,6 +21,7 @@
 --------------------
 
   * evolve: specific the source of config override for `server.bundle1=no`
+  * metaedit: update bookmark location when applicable
 
 10.0.2 -- 2020-09-08
 --------------------
--- a/README.rst	Sun Oct 11 20:50:02 2020 +0800
+++ b/README.rst	Thu Oct 15 19:46:38 2020 +0200
@@ -180,8 +180,8 @@
 Format-source config
 ====================
 
-Format source helps smooth out the pain of merging after auto-formatting.
-Follow the instructions for install here:
+Format-source helps smooth out the pain of merging after auto-formatting.
+Follow the installation instructions at the `format-source`_ repo.
 
 .. _`format-source`: https://foss.heptapod.net/mercurial/format-source
 
--- a/hgext3rd/evolve/cmdrewrite.py	Sun Oct 11 20:50:02 2020 +0800
+++ b/hgext3rd/evolve/cmdrewrite.py	Thu Oct 15 19:46:38 2020 +0200
@@ -169,9 +169,9 @@
         metadata = {}
         if opts.get('note'):
             metadata[b'note'] = opts['note']
-        replacements = {old.node(): [newnode]}
-        scmutil.cleanupnodes(repo, replacements, operation=b'amend',
-                             metadata=metadata)
+        replacements = {(old.node(),): [newnode]}
+        compat.cleanupnodes(repo, replacements, operation=b'amend',
+                            metadata=metadata)
         phases.retractboundary(repo, tr, old.phase(), [newnode])
         compat.clean_update(repo[newnode])
 
@@ -508,9 +508,9 @@
         if opts.get('note'):
             metadata[b'note'] = opts['note']
 
-        replacements = {old.node(): [newid]}
-        scmutil.cleanupnodes(repo, replacements, operation=b"uncommit",
-                             metadata=metadata)
+        replacements = {(old.node(),): [newid]}
+        compat.cleanupnodes(repo, replacements, operation=b"uncommit",
+                            metadata=metadata)
         phases.retractboundary(repo, tr, oldphase, [newid])
         if opts.get('revert'):
             compat.clean_update(repo[newid])
@@ -745,17 +745,9 @@
                                                          p2.node()],
                                                         commitopts=commitopts)
             phases.retractboundary(repo, tr, targetphase, [newid])
-            # Use this condition as a proxy since the commit we care about
-            # (b99903534e06) didn't change any signatures.
-            if util.safehasattr(scmutil, 'nullrev'):
-                replacements = {tuple(ctx.node() for ctx in allctx): [newid]}
-                scmutil.cleanupnodes(repo, replacements, operation=b"fold",
-                                     metadata=metadata)
-            else:
-                # hg <= 4.7 (b99903534e06)
-                replacements = {ctx.node(): [newid] for ctx in allctx}
-                scmutil.cleanupnodes(repo, replacements, operation=b"fold",
-                                     metadata=metadata)
+            replacements = {tuple(ctx.node() for ctx in allctx): [newid]}
+            compat.cleanupnodes(repo, replacements, operation=b"fold",
+                                metadata=metadata)
             tr.close()
         finally:
             tr.release()
@@ -1031,9 +1023,9 @@
             msg = b"please add --fold if you want to do a fold"
             raise error.Abort(msg)
         elif biject:
-            replacements = {p.node(): [s.node()] for p, s in zip(precs, sucs)}
+            replacements = {(p.node(),): [s.node()] for p, s in zip(precs, sucs)}
         else:
-            replacements = {p.node(): [s.node() for s in sucs] for p in precs}
+            replacements = {(p.node(),): [s.node() for s in sucs] for p in precs}
 
         wdp = repo[b'.']
 
@@ -1113,16 +1105,13 @@
             # but then revset took a lazy arrow in the knee and became much
             # slower. The new forms makes as much sense and a much faster.
             for dest in ctx.ancestors():
-                if not dest.obsolete() and dest.node() not in replacements:
+                if not dest.obsolete() and (dest.node(),) not in replacements:
                     moves[ctx.node()] = dest.node()
                     break
         if len(sucs) == 1 and len(precs) > 1 and fold:
-            # hg <= 4.7 (b99903534e06)
-            # Using a proxy condition to let people wrap cleanupnodes()
-            if util.safehasattr(scmutil, 'nullrev'):
-                replacements = {tuple(p.node() for p in precs): [s.node() for s in sucs]}
-        scmutil.cleanupnodes(repo, replacements, operation=b"prune", moves=moves,
-                             metadata=metadata)
+            replacements = {tuple(p.node() for p in precs): [s.node() for s in sucs]}
+        compat.cleanupnodes(repo, replacements, operation=b"prune", moves=moves,
+                            metadata=metadata)
 
         # informs that changeset have been pruned
         ui.status(_(b'%i changesets pruned\n') % len(precs))
@@ -1476,11 +1465,11 @@
         if pickstate:
             pickstate.delete()
         if newnode is None:
-            replacements = {origctx.node(): []}
+            replacements = {(origctx.node(),): []}
         else:
             newctx = repo[newnode]
-            replacements = {origctx.node(): [newctx.node()]}
-        scmutil.cleanupnodes(repo, replacements, operation=b"pick")
+            replacements = {(origctx.node(),): [newctx.node()]}
+        compat.cleanupnodes(repo, replacements, operation=b"pick")
 
         if newnode is None:
             ui.warn(_(b"note: picking %d:%s created no changes to commit\n") %
--- a/hgext3rd/evolve/compat.py	Sun Oct 11 20:50:02 2020 +0800
+++ b/hgext3rd/evolve/compat.py	Thu Oct 15 19:46:38 2020 +0200
@@ -411,3 +411,18 @@
 
     def clean_update(ctx):
         hg.updaterepo(ctx.repo(), ctx.node(), overwrite=True)
+
+def cleanupnodes(repo, replacements, operation, moves=None, metadata=None):
+    # Use this condition as a proxy since the commit we care about
+    # (b99903534e06) didn't change any signatures.
+    if util.safehasattr(scmutil, 'nullrev'):
+        fixedreplacements = replacements
+    else:
+        # hg <= 4.7 (b99903534e06)
+        fixedreplacements = {}
+        for oldnodes, newnodes in replacements.items():
+            for oldnode in oldnodes:
+                fixedreplacements[oldnode] = newnodes
+
+    scmutil.cleanupnodes(repo, replacements=fixedreplacements, operation=operation,
+                         moves=moves, metadata=metadata)
--- a/tests/test-evolve-progress.t	Sun Oct 11 20:50:02 2020 +0800
+++ b/tests/test-evolve-progress.t	Thu Oct 15 19:46:38 2020 +0200
@@ -123,6 +123,7 @@
    branchmerge: True, force: True, partial: False
    ancestor: 152c368c622b, local: f8d7d38c0a88+, remote: df5d742141b0
    preserving a for resolve of a
+  starting 4 threads for background file closing (?)
    a: versions differ -> m (premerge)
   updating: a 1/1 files (100.00%)
   picked tool ':merge' for a (binary False symlink False changedelete False)