tests: add more tests for debugconvertbookmark
authorPulkit Goyal <7895pulkit@gmail.com>
Tue, 29 Aug 2017 18:13:33 +0530
changeset 2901 52e6b28704a7
parent 2900 1928e9c802dd
child 2902 f6e297fda5c6
tests: add more tests for debugconvertbookmark
tests/test-topic-debugcb.t
--- a/tests/test-topic-debugcb.t	Mon Aug 14 14:36:11 2017 +0530
+++ b/tests/test-topic-debugcb.t	Tue Aug 29 18:13:33 2017 +0530
@@ -4,12 +4,16 @@
   $ . "$TESTDIR/testlib/topic_setup.sh"
 
   $ cat << EOF >> $HGRCPATH
+  > drawdag=$RUNTESTDIR/drawdag.py
   > [ui]
   > logtemplate = [{rev}:{node|short}] {desc|firstline}\n\
   > {if(bookmarks, "  bookmark: {join(bookmarks,"\n  bookmark:")}\n")}\
   > {if(topics, "  topic: {topics}\n")}
   > EOF
 
+Setting up the things
+=====================
+
   $ hg init repo
   $ cd repo
   $ echo "Hello" > a
@@ -121,3 +125,112 @@
   |/     topic: hellos
   o  [0:3caf92e45cfb] First commit
   
+Another setup
+==============
+
+  $ cd ..
+  $ rm -rf repo
+  $ hg init setup1
+  $ cd setup1
+  $ hg debugdrawdag <<EOF
+  > D F
+  > | |
+  > C E
+  > |/
+  > B
+  > |
+  > A
+  > EOF
+
+  $ hg log -G
+  o  [5:11abe3fb10b8] F
+  |
+  | o  [4:f585351a92f8] D
+  | |
+  o |  [3:49cb92066bfd] E
+  | |
+  | o  [2:26805aba1e60] C
+  |/
+  o  [1:112478962961] B
+  |
+  o  [0:426bada5c675] A
+  
+  $ hg bookmark -r 5 foo
+  $ hg bookmark -r 4 bar
+  $ hg debugconvertbookmark --all
+  changed topic to "bar" on 2 revisions
+  changed topic to "foo" on 2 revisions
+  $ hg log -G
+  o  [9:f07a5aaa3365] F
+  |    topic: foo
+  o  [8:00a25ca4fa07] E
+  |    topic: foo
+  | o  [7:603a45fb0033] D
+  | |    topic: bar
+  | o  [6:67dd4179b021] C
+  |/     topic: bar
+  | x  [5:11abe3fb10b8] F
+  | |
+  | | x  [4:f585351a92f8] D
+  | | |
+  | x |  [3:49cb92066bfd] E
+  |/ /
+  | x  [2:26805aba1e60] C
+  |/
+  o  [1:112478962961] B
+  |
+  o  [0:426bada5c675] A
+  
+Another Setup
+=============
+
+  $ cd ..
+  $ rm -rf setup1
+  $ hg init setup2
+  $ cd setup2
+  $ hg debugdrawdag <<EOF
+  > E
+  > |
+  > D
+  > |
+  > C
+  > |
+  > B
+  > |
+  > A
+  > EOF
+
+  $ hg log -G
+  o  [4:9bc730a19041] E
+  |
+  o  [3:f585351a92f8] D
+  |
+  o  [2:26805aba1e60] C
+  |
+  o  [1:112478962961] B
+  |
+  o  [0:426bada5c675] A
+  
+  $ hg bookmark -r 4 foo
+  $ hg bookmark -r 2 bar
+
+XXX: this should bot only put topic 'foo' on 3,4 but also 'bar' on 0,1,2
+
+  $ hg debugconvertbookmark --all
+  changed topic to "foo" on 2 revisions
+
+  $ hg log -G
+  o  [6:4442f18c04c6] E
+  |    topic: foo
+  o  [5:0f81d1dec575] D
+  |    topic: foo
+  | x  [4:9bc730a19041] E
+  | |
+  | x  [3:f585351a92f8] D
+  |/
+  o  [2:26805aba1e60] C
+  |    bookmark: bar
+  o  [1:112478962961] B
+  |
+  o  [0:426bada5c675] A
+