changeset 6119:b883fc38e07c stable

tests: add a case for issue6550 where s0 has no topic
author Anton Shestakov <av6@dwimlabs.net>
date Tue, 11 Jan 2022 08:19:53 +0300
parents 5d1bfde39b95
children d3fb823f0c36
files tests/test-issue6550.t
diffstat 1 files changed, 37 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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 ..