changeset 5547:6cd66a5bfb04 stable

metaedit: switch to cleanupnodes() so e.g. bookmarks are moved
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 25 Aug 2020 22:34:33 -0700
parents f36d6846e1e6
children 7370725cdba7
files CHANGELOG hgext3rd/evolve/cmdrewrite.py tests/test-metaedit.t
diffstat 3 files changed, 11 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGELOG	Tue Aug 25 22:50:28 2020 -0700
+++ b/CHANGELOG	Tue Aug 25 22:34:33 2020 -0700
@@ -5,6 +5,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/hgext3rd/evolve/cmdrewrite.py	Tue Aug 25 22:50:28 2020 -0700
+++ b/hgext3rd/evolve/cmdrewrite.py	Tue Aug 25 22:34:33 2020 -0700
@@ -883,14 +883,16 @@
 
                 phases.retractboundary(repo, tr, targetphase, [newid])
                 # Use this condition as a proxy since the commit we care about
-                # (6335c0de80fa) didn't change any signatures.
-                if not util.safehasattr(context, 'bin'):
-                    obsolete.createmarkers(repo, [(tuple(allctx), (repo[newid],))],
-                                           metadata=metadata, operation=b"metaedit")
+                # (b99903534e06) didn't change any signatures.
+                if util.safehasattr(scmutil, 'nullrev'):
+                    mapping = {tuple(ctx.node() for ctx in allctx): (newid,)}
+                    scmutil.cleanupnodes(repo, mapping, operation=b"metaedit",
+                                         metadata=metadata)
                 else:
-                    # hg <= 4.7 (6335c0de80fa)
-                    obsolete.createmarkers(repo, [(ctx, (repo[newid],)) for ctx in allctx],
-                                           metadata=metadata, operation=b"metaedit")
+                    # hg <= 4.7 (b99903534e06)
+                    mapping = {ctx.node(): (newid,) for ctx in allctx}
+                    scmutil.cleanupnodes(repo, mapping, operation=b"metaedit",
+                                         metadata=metadata)
             else:
                 ui.status(_(b"nothing changed\n"))
             tr.close()
--- a/tests/test-metaedit.t	Tue Aug 25 22:50:28 2020 -0700
+++ b/tests/test-metaedit.t	Tue Aug 25 22:34:33 2020 -0700
@@ -265,12 +265,8 @@
   A E
   A F
   $ hg gluf
-  @  15: squashed - mr-squasher (C D E F)
+  @  15 bookmark-D: squashed - mr-squasher (C D E F)
   |
-  | x  12 bookmark-D: D2 - foobar3 (D)
-  | |
-  | x  3: C - test (C)
-  |/
   | o  2: B - test (B)
   |/
   o  1: A - test (A)