Skip to content
Snippets Groups Projects
test-issue6550.t 1.03 KiB
Newer Older
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 ..