# HG changeset patch # User Anton Shestakov # Date 1649249874 -10800 # Node ID 6faab8daf02aeedf30250d3f1030179b876584ba # Parent 6ae0077e416e7a2c779a71a7d93b3d6c8c2340a4 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. diff -r 6ae0077e416e -r 6faab8daf02a CHANGELOG --- 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 -------------------- diff -r 6ae0077e416e -r 6faab8daf02a hgext3rd/evolve/cmdrewrite.py --- 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): diff -r 6ae0077e416e -r 6faab8daf02a tests/test-fixup.t --- 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 .