changeset 6211:6faab8daf02a stable

fixup: work correctly with bookmarks Initializing bookmarkchanges to an empty list is required when finalizing relocation of a node that has one or more bookmarks. Other commands that use evolvecmd._relocate() already do this.
author Anton Shestakov <av6@dwimlabs.net>
date Wed, 06 Apr 2022 15:57:54 +0300
parents 6ae0077e416e
children fc877278f79e
files CHANGELOG hgext3rd/evolve/cmdrewrite.py tests/test-fixup.t
diffstat 3 files changed, 19 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGELOG	Fri Apr 01 21:59:32 2022 +0200
+++ b/CHANGELOG	Wed Apr 06 15:57:54 2022 +0300
@@ -1,6 +1,11 @@
 Changelog
 =========
 
+10.5.1 - in progress
+--------------------
+
+  * fixup: work correctly with bookmarks
+
 10.5.0 -- 2022-02-23
 --------------------
 
--- a/hgext3rd/evolve/cmdrewrite.py	Fri Apr 01 21:59:32 2022 +0200
+++ b/hgext3rd/evolve/cmdrewrite.py	Wed Apr 06 15:57:54 2022 +0300
@@ -1509,7 +1509,10 @@
         raise error.Abort(_(b'please specify a revision to fixup'))
     target_ctx = scmutil.revsingle(repo, node)
 
-    fixup_state[b'startnode'] = repo[b'.'].node()
+    fixup_state.addopts({
+        b'bookmarkchanges': [],
+        b'startnode': repo[b'.'].node(),
+    })
 
     tr = repo.transaction(b'fixup')
     with util.acceptintervention(tr):
--- a/tests/test-fixup.t	Fri Apr 01 21:59:32 2022 +0200
+++ b/tests/test-fixup.t	Wed Apr 06 15:57:54 2022 +0300
@@ -56,8 +56,10 @@
 amending the middle of the stack
 --------------------------------
 
+  $ hg bookmark bm
   $ echo 'hookah bar' > bar
   $ hg fixup -r 'desc(bar)'
+  (leaving bookmark bm)
   1 new orphan changesets
 
   $ hg diff -c tip
@@ -70,7 +72,7 @@
 
   $ hg glog
   o  5:2eec5320cfc7 bar
-  |   () draft
+  |   (bm) draft
   | @  3:fd2f632e47ab temporary fixup commit
   | |   () draft
   | *  2:a425495a8e64 baz
@@ -82,7 +84,7 @@
 
   $ hg glog --hidden
   o  5:2eec5320cfc7 bar
-  |   () draft
+  |   (bm) draft
   | x  4:4869c1db2884 temporary fixup commit
   | |   () draft
   | | @  3:fd2f632e47ab temporary fixup commit
@@ -107,7 +109,7 @@
   o  6:eb1755d9f810 baz
   |   () draft
   @  5:2eec5320cfc7 bar
-  |   () draft
+  |   (bm) draft
   o  0:e63c23eaa88a foo
       () draft
 
@@ -128,7 +130,7 @@
   @  9:12b5e442244f baz
   |   () secret
   o  5:2eec5320cfc7 bar
-  |   () draft
+  |   (bm) draft
   o  0:e63c23eaa88a foo
       () draft
 
@@ -149,7 +151,7 @@
   | @  9:12b5e442244f baz
   | |   () secret
   | o  5:2eec5320cfc7 bar
-  |/    () draft
+  |/    (bm) draft
   o  0:e63c23eaa88a foo
       () draft
 
@@ -249,7 +251,7 @@
   | o  9:12b5e442244f baz
   | |   () secret
   | o  5:2eec5320cfc7 bar
-  |/    () draft
+  |/    (bm) draft
   o  0:e63c23eaa88a foo
       () draft
 
@@ -273,7 +275,7 @@
   | | o  13:fed7e534b3bb update foo
   | |/    () draft
   o |  5:2eec5320cfc7 bar
-  |/    () draft
+  |/    (bm) draft
   o  0:e63c23eaa88a foo
       () draft
 
@@ -288,7 +290,7 @@
   | o  13:fed7e534b3bb update foo
   | |   () draft
   o |  5:2eec5320cfc7 bar
-  |/    () draft
+  |/    (bm) draft
   o  0:e63c23eaa88a foo
       () draft
   $ hg diff -c .