# HG changeset patch # User Anton Shestakov # Date 1641878393 -10800 # Node ID b883fc38e07c5f93f89047ba0993ad8c34a32a12 # Parent 5d1bfde39b95a733c1ed80488f400e218846cdc0 tests: add a case for issue6550 where s0 has no topic diff -r 5d1bfde39b95 -r b883fc38e07c tests/test-issue6550.t --- a/tests/test-issue6550.t Fri Jan 07 18:06:46 2022 +0100 +++ b/tests/test-issue6550.t Tue Jan 11 08:19:53 2022 +0300 @@ -85,3 +85,40 @@ o 0:c051488dac25 [topic1] A $ cd .. + +Editing commits with a topic on top of a commit without a topic: + + $ hg init repo3 + $ cd repo3 + $ echo 1 > A + $ hg ci -Aqm A + $ hg topic topic1 + marked working directory as topic: topic1 + $ echo 1 > B + $ hg ci -Aqm B + $ echo 1 > C + $ hg ci -Aqm C + $ hg glog + @ 2:c3dae6eda73b [topic1] C + | + o 1:db3a7c9052ac [topic1] B + | + o 0:a18fe624bf77 [] A + +Swap the order of commits B and C + + $ hg histedit s1 -q --commands - 2>&1 << EOF + > pick c3dae6eda73b C + > pick db3a7c9052ac B + > EOF + +Topic of B and C is preserved + + $ hg glog + @ 4:aa7af5cc1567 [topic1] B + | + o 3:4bf8cf7b2c73 [topic1] C + | + o 0:a18fe624bf77 [] A + + $ cd ..