changeset 6116:b0443b54160c stable

tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
author Simon Sapin <simon.sapin@octobus.net>
date Fri, 07 Jan 2022 17:18:47 +0100
parents df204c64faab
children a27bdd116761
files tests/test-check-sdist.t tests/test-issue6550.t
diffstat 2 files changed, 50 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-check-sdist.t	Sat Nov 20 08:35:06 2021 +0300
+++ b/tests/test-check-sdist.t	Fri Jan 07 17:18:47 2022 +0100
@@ -35,7 +35,7 @@
 
   $ tar -tzf hg-evolve-*.tar.gz | sed 's|^hg-evolve-[^/]*/||' | sort > files
   $ wc -l files
-  352 files
+  353 files
   $ fgrep debian files
   tests/test-check-debian.t
   $ fgrep __init__.py files
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-issue6550.t	Fri Jan 07 17:18:47 2022 +0100
@@ -0,0 +1,49 @@
+histedit should preserve topics (issue6550)
+https://bz.mercurial-scm.org/show_bug.cgi?id=6550
+
+  $ . "$TESTDIR/testlib/topic_setup.sh"
+
+  $ cat << EOF >> "$HGRCPATH"
+  > [extensions]
+  > histedit =
+  > [alias]
+  > glog = log -G --template "{rev}:{node|short} [{topic}] {desc}\n"
+  > EOF
+
+Editing commits with one topic on top of a commit with a different topic:
+
+  $ hg init repo1
+  $ cd repo1
+  $ hg topic topic1
+  marked working directory as topic: topic1
+  $ echo 1 > A
+  $ hg ci -Aqm A
+  $ hg topic topic2
+  $ echo 1 > B
+  $ hg ci -Aqm B
+  $ echo 1 > C
+  $ hg ci -Aqm C
+  $ hg glog
+  @  2:392a64d00726 [topic2] C
+  |
+  o  1:8a25a1549e46 [topic2] B
+  |
+  o  0:c051488dac25 [topic1] A
+  
+Swap the order of commits B and C
+
+  $ hg histedit s1 -q --commands - 2>&1 << EOF
+  > pick 392a64d00726 C
+  > pick 8a25a1549e46 B
+  > EOF
+
+Topics of B and C have incorrectly be set to topic1:
+
+  $ hg glog
+  @  4:3bf79df9dd38 [topic1] B (known-bad-output !)
+  |
+  o  3:c51ea384abdd [topic1] C (known-bad-output !)
+  |
+  o  0:c051488dac25 [topic1] A
+  
+  $ cd ..