tests/test-topic-stack.t
branchmercurial-4.1
changeset 3002 00e4d31b8cdb
parent 2809 f25c79365f5d
parent 3000 bd7e8be29542
child 3109 3024ae293732
equal deleted inserted replaced
2809:f25c79365f5d 3002:00e4d31b8cdb
    13   > EOF
    13   > EOF
    14 
    14 
    15   $ hg init main
    15   $ hg init main
    16   $ cd main
    16   $ cd main
    17   $ hg topic other
    17   $ hg topic other
       
    18   marked working directory as topic: other
    18   $ echo aaa > aaa
    19   $ echo aaa > aaa
    19   $ hg add aaa
    20   $ hg add aaa
    20   $ hg commit -m c_a
    21   $ hg commit -m c_a
       
    22   active topic 'other' grew its first changeset
    21   $ echo aaa > bbb
    23   $ echo aaa > bbb
    22   $ hg add bbb
    24   $ hg add bbb
    23   $ hg commit -m c_b
    25   $ hg commit -m c_b
    24   $ hg topic foo
    26   $ hg topic foo
    25   $ echo aaa > ccc
    27   $ echo aaa > ccc
    26   $ hg add ccc
    28   $ hg add ccc
    27   $ hg commit -m c_c
    29   $ hg commit -m c_c
       
    30   active topic 'foo' grew its first changeset
    28   $ echo aaa > ddd
    31   $ echo aaa > ddd
    29   $ hg add ddd
    32   $ hg add ddd
    30   $ hg commit -m c_d
    33   $ hg commit -m c_d
    31   $ echo aaa > eee
    34   $ echo aaa > eee
    32   $ hg add eee
    35   $ hg add eee
    54   $ hg up other
    57   $ hg up other
    55   switching to topic other
    58   switching to topic other
    56   0 files updated, 0 files merged, 4 files removed, 0 files unresolved
    59   0 files updated, 0 files merged, 4 files removed, 0 files unresolved
    57   $ hg topic --list
    60   $ hg topic --list
    58   ### topic: other
    61   ### topic: other
    59   ### branch: default
    62   ### target: default (branch)
    60   t2@ c_b (current)
    63   t2@ c_b (current)
    61   t1: c_a
    64   t1: c_a
    62   $ hg phase --public 'topic("other")'
    65   $ hg phase --public 'topic("other")'
       
    66   active topic 'other' is now empty
       
    67 
       
    68 After changing the phase of all the changesets in "other" to public, the topic should still be active, but is empty. We should be better at informating the user about it and displaying good data in this case.
       
    69 
       
    70   $ hg topic
       
    71      foo
       
    72    * other
       
    73   $ hg stack
       
    74   ### topic: other
       
    75   ### target: default (branch)
       
    76   (stack is empty)
       
    77   t0^ c_b (base)
       
    78 
    63   $ hg up foo
    79   $ hg up foo
    64   switching to topic foo
    80   switching to topic foo
    65   4 files updated, 0 files merged, 0 files removed, 0 files unresolved
    81   4 files updated, 0 files merged, 0 files removed, 0 files unresolved
    66 
    82 
    67 Simple test
    83 Simple test
    71 
    87 
    72   $ hg topic
    88   $ hg topic
    73    * foo
    89    * foo
    74   $ hg stack
    90   $ hg stack
    75   ### topic: foo
    91   ### topic: foo
    76   ### branch: default
    92   ### target: default (branch)
    77   t4@ c_f (current)
    93   t4@ c_f (current)
    78   t3: c_e
    94   t3: c_e
    79   t2: c_d
    95   t2: c_d
    80   t1: c_c
    96   t1: c_c
    81   t0^ c_b (base)
    97   t0^ c_b (base)
    82   $ hg stack -v
    98   $ hg stack -v
    83   ### topic: foo
    99   ### topic: foo
    84   ### branch: default
   100   ### target: default (branch)
    85   t4(6559e6d93aea)@ c_f (current)
   101   t4(6559e6d93aea)@ c_f (current)
    86   t3(0f9ac936c87d): c_e
   102   t3(0f9ac936c87d): c_e
    87   t2(e629654d7050): c_d
   103   t2(e629654d7050): c_d
    88   t1(8522f9e3fee9): c_c
   104   t1(8522f9e3fee9): c_c
    89   t0(ea705abc4f51)^ c_b (base)
   105   t0(ea705abc4f51)^ c_b (base)
   193 
   209 
   194   $ hg topics
   210   $ hg topics
   195    * foo
   211    * foo
   196   $ hg stack
   212   $ hg stack
   197   ### topic: foo
   213   ### topic: foo
   198   ### branch: default
   214   ### target: default (branch)
   199   t4@ c_f (current)
   215   t4@ c_f (current)
   200   t3: c_e
   216   t3: c_e
   201   t2: c_d
   217   t2: c_d
   202   t1: c_c
   218   t1: c_c
   203   t0^ c_b (base)
   219   t0^ c_b (base)
   204   $ hg topics --config ui.strict=true
   220   $ hg topics --config ui.strict=true
   205    * foo
   221    * foo
   206   $ hg stack --config ui.strict=true
   222   $ hg stack --config ui.strict=true
   207   ### topic: foo
   223   ### topic: foo
   208   ### branch: default
   224   ### target: default (branch)
   209   t4@ c_f (current)
   225   t4@ c_f (current)
   210   t3: c_e
   226   t3: c_e
   211   t2: c_d
   227   t2: c_d
   212   t1: c_c
   228   t1: c_c
   213   t0^ c_b (base)
   229   t0^ c_b (base)
   214 
   230 
   215 error case, nothing to list
   231 error case, nothing to list
   216 
   232 
   217   $ hg topic --clear
   233   $ hg topic --clear
   218   $ hg stack
   234   $ hg stack
   219   ### branch: 
   235   ### target: default (branch)
       
   236   (stack is empty)
       
   237   b0^ c_f (base)
   220 
   238 
   221 Test "t#" reference
   239 Test "t#" reference
   222 -------------------
   240 -------------------
   223 
   241 
   224 
   242 
   225   $ hg up t2
   243   $ hg up t2
   226   abort: cannot resolve "t2": no active topic
   244   abort: cannot resolve "t2": no active topic
   227   [255]
   245   [255]
   228   $ hg topic foo
   246   $ hg topic foo
       
   247   marked working directory as topic: foo
   229   $ hg up t42
   248   $ hg up t42
   230   abort: cannot resolve "t42": topic "foo" has only 4 changesets
   249   abort: cannot resolve "t42": topic "foo" has only 4 changesets
   231   [255]
   250   [255]
   232   $ hg up t2
   251   $ hg up t2
   233   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
   252   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
   260   |
   279   |
   261   o  0 default {} public c_a
   280   o  0 default {} public c_a
   262   
   281   
   263   $ hg topic --list
   282   $ hg topic --list
   264   ### topic: foo
   283   ### topic: foo
   265   ### branch: default
   284   ### target: default (branch)
   266   t4$ c_f (unstable)
   285   t4$ c_f (unstable)
   267   t3$ c_e (unstable)
   286   t3$ c_e (unstable)
   268   t2@ c_d (current)
   287   t2@ c_d (current)
   269   t1: c_c
   288   t1: c_c
   270   t0^ c_b (base)
   289   t0^ c_b (base)
   271   $ hg up t3
   290   $ hg up t3
   272   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   291   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   273   $ hg topic --list
   292   $ hg topic --list
   274   ### topic: foo
   293   ### topic: foo
   275   ### branch: default
   294   ### target: default (branch)
   276   t4$ c_f (unstable)
   295   t4$ c_f (unstable)
   277   t3$ c_e (current unstable)
   296   t3$ c_e (current unstable)
   278   t2: c_d
   297   t2: c_d
   279   t1: c_c
   298   t1: c_c
   280   t0^ c_b (base)
   299   t0^ c_b (base)
   281   $ hg topic --list --color=debug
   300   $ hg topic --list --color=debug
   282   [topic.stack.summary.topic|### topic: [topic.active|foo]]
   301   [topic.stack.summary.topic|### topic: [topic.active|foo]]
   283   [topic.stack.summary.branches|### branch: default]
   302   [topic.stack.summary.branches|### target: default (branch)]
   284   [topic.stack.index topic.stack.index.unstable|t4][topic.stack.state topic.stack.state.unstable|$] [topic.stack.desc topic.stack.desc.unstable|c_f][topic.stack.state topic.stack.state.unstable| (unstable)]
   303   [topic.stack.index topic.stack.index.unstable|t4][topic.stack.state topic.stack.state.unstable|$] [topic.stack.desc topic.stack.desc.unstable|c_f][topic.stack.state topic.stack.state.unstable| (unstable)]
   285   [topic.stack.index topic.stack.index.current topic.stack.index.unstable|t3][topic.stack.state topic.stack.state.current topic.stack.state.unstable|$] [topic.stack.desc topic.stack.desc.current topic.stack.desc.unstable|c_e][topic.stack.state topic.stack.state.current topic.stack.state.unstable| (current unstable)]
   304   [topic.stack.index topic.stack.index.current topic.stack.index.unstable|t3][topic.stack.state topic.stack.state.current topic.stack.state.unstable|$] [topic.stack.desc topic.stack.desc.current topic.stack.desc.unstable|c_e][topic.stack.state topic.stack.state.current topic.stack.state.unstable| (current unstable)]
   286   [topic.stack.index topic.stack.index.clean|t2][topic.stack.state topic.stack.state.clean|:] [topic.stack.desc topic.stack.desc.clean|c_d]
   305   [topic.stack.index topic.stack.index.clean|t2][topic.stack.state topic.stack.state.clean|:] [topic.stack.desc topic.stack.desc.clean|c_d]
   287   [topic.stack.index topic.stack.index.clean|t1][topic.stack.state topic.stack.state.clean|:] [topic.stack.desc topic.stack.desc.clean|c_c]
   306   [topic.stack.index topic.stack.index.clean|t1][topic.stack.state topic.stack.state.clean|:] [topic.stack.desc topic.stack.desc.clean|c_c]
   288   [topic.stack.index topic.stack.index.base|t0][topic.stack.state topic.stack.state.base|^] [topic.stack.desc topic.stack.desc.base|c_b][topic.stack.state topic.stack.state.base| (base)]
   307   [topic.stack.index topic.stack.index.base|t0][topic.stack.state topic.stack.state.base|^] [topic.stack.desc topic.stack.desc.base|c_b][topic.stack.state topic.stack.state.base| (base)]
   358 
   377 
   359 Test output
   378 Test output
   360 
   379 
   361   $ hg top -l
   380   $ hg top -l
   362   ### topic: foo (2 heads)
   381   ### topic: foo (2 heads)
   363   ### branch: default
   382   ### target: default (branch)
   364   t6: c_f
   383   t6: c_f
   365   t5: c_e
   384   t5: c_e
   366   t2^ c_d (base)
   385   t2^ c_d (base)
   367   t4@ c_h (current)
   386   t4@ c_h (current)
   368   t3: c_g
   387   t3: c_g
   402   o  0 default {} public c_a
   421   o  0 default {} public c_a
   403   
   422   
   404 
   423 
   405   $ hg topic --list
   424   $ hg topic --list
   406   ### topic: foo (2 heads)
   425   ### topic: foo (2 heads)
   407   ### branch: default
   426   ### target: default (branch)
   408   t6$ c_f (unstable)
   427   t6$ c_f (unstable)
   409   t5$ c_e (unstable)
   428   t5$ c_e (unstable)
   410   t2^ c_D (base)
   429   t2^ c_D (base)
   411   t4: c_h
   430   t4: c_h
   412   t3: c_g
   431   t3: c_g
   420   [255]
   439   [255]
   421   $ hg topic --list thisdoesnotexist
   440   $ hg topic --list thisdoesnotexist
   422   abort: cannot resolve "thisdoesnotexist": no such topic found
   441   abort: cannot resolve "thisdoesnotexist": no such topic found
   423   [255]
   442   [255]
   424 
   443 
       
   444 Complex cases where commits with same topic are not consecutive but are linear
       
   445 ==============================================================================
       
   446 
       
   447   $ hg log --graph
       
   448   o  15 default {foo} draft c_h
       
   449   |
       
   450   o  14 default {foo} draft c_g
       
   451   |
       
   452   @  13 default {foo} draft c_D
       
   453   |
       
   454   | o  9 default {foo} draft c_f
       
   455   | |
       
   456   | o  8 default {foo} draft c_e
       
   457   | |
       
   458   | x  7 default {foo} draft c_d
       
   459   |/
       
   460   o  2 default {foo} draft c_c
       
   461   |
       
   462   o  1 default {} public c_b
       
   463   |
       
   464   o  0 default {} public c_a
       
   465   
       
   466 Converting into a linear chain
       
   467   $ hg rebase -s 'desc("c_e") - obsolete()' -d 'desc("c_h") - obsolete()'
       
   468   rebasing 8:215bc359096a "c_e"
       
   469   rebasing 9:ec9267b3f33f "c_f"
       
   470 
       
   471   $ hg log -G
       
   472   o  17 default {foo} draft c_f
       
   473   |
       
   474   o  16 default {foo} draft c_e
       
   475   |
       
   476   o  15 default {foo} draft c_h
       
   477   |
       
   478   o  14 default {foo} draft c_g
       
   479   |
       
   480   @  13 default {foo} draft c_D
       
   481   |
       
   482   o  2 default {foo} draft c_c
       
   483   |
       
   484   o  1 default {} public c_b
       
   485   |
       
   486   o  0 default {} public c_a
       
   487   
       
   488 Changing topics on some commits in between
       
   489   $ hg topic foobar -r 'desc(c_e) + desc(c_D)'
       
   490   switching to topic foobar
       
   491   changed topic on 2 changes
       
   492   $ hg log -G
       
   493   @  19 default {foobar} draft c_D
       
   494   |
       
   495   | o  18 default {foobar} draft c_e
       
   496   | |
       
   497   | | o  17 default {foo} draft c_f
       
   498   | | |
       
   499   | | x  16 default {foo} draft c_e
       
   500   | |/
       
   501   | o  15 default {foo} draft c_h
       
   502   | |
       
   503   | o  14 default {foo} draft c_g
       
   504   | |
       
   505   | x  13 default {foo} draft c_D
       
   506   |/
       
   507   o  2 default {foo} draft c_c
       
   508   |
       
   509   o  1 default {} public c_b
       
   510   |
       
   511   o  0 default {} public c_a
       
   512   
       
   513   $ hg rebase -s 'desc("c_f") - obsolete()' -d 'desc("c_e") - obsolete()'
       
   514   rebasing 17:77082e55de88 "c_f"
       
   515   switching to topic foo
       
   516   switching to topic foobar
       
   517   $ hg rebase -s 'desc("c_g") - obsolete()' -d 'desc("c_D") - obsolete()'
       
   518   rebasing 14:0c3e8aed985d "c_g"
       
   519   switching to topic foo
       
   520   rebasing 15:b9e4f3709bc5 "c_h"
       
   521   rebasing 18:4bc813530301 "c_e"
       
   522   switching to topic foobar
       
   523   rebasing 20:4406ea4be852 "c_f" (tip)
       
   524   switching to topic foo
       
   525   switching to topic foobar
       
   526   $ hg up
       
   527   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   528   $ hg log --graph
       
   529   o  24 default {foo} draft c_f
       
   530   |
       
   531   @  23 default {foobar} draft c_e
       
   532   |
       
   533   o  22 default {foo} draft c_h
       
   534   |
       
   535   o  21 default {foo} draft c_g
       
   536   |
       
   537   o  19 default {foobar} draft c_D
       
   538   |
       
   539   o  2 default {foo} draft c_c
       
   540   |
       
   541   o  1 default {} public c_b
       
   542   |
       
   543   o  0 default {} public c_a
       
   544   
       
   545 XXX: The following should show single heads
       
   546 XXX: The behind count is weird, because the topic are interleaved.
       
   547 
       
   548   $ hg stack
       
   549   ### topic: foobar
       
   550   ### target: default (branch), 3 behind
       
   551   t2@ c_e (current)
       
   552     ^ c_h
       
   553   t1: c_D
       
   554   t0^ c_c (base)
       
   555 
       
   556   $ hg stack foo
       
   557   ### topic: foo
       
   558   ### target: default (branch), ambigious rebase destination - topic 'foo' has 3 heads
       
   559   t4: c_f
       
   560     ^ c_e
       
   561   t3: c_h
       
   562   t2: c_g
       
   563     ^ c_D
       
   564   t1: c_c
       
   565   t0^ c_b (base)
       
   566 
       
   567 case involving a merge
       
   568 ----------------------
       
   569 
       
   570   $ cd ..
       
   571   $ hg init stack-gap-merge
       
   572   $ cd stack-gap-merge
       
   573 
       
   574   $ echo aaa > aaa
       
   575   $ hg commit -Am 'c_A'
       
   576   adding aaa
       
   577   $ hg topic red
       
   578   marked working directory as topic: red
       
   579   $ echo bbb > bbb
       
   580   $ hg commit -Am 'c_B'
       
   581   adding bbb
       
   582   active topic 'red' grew its first changeset
       
   583   $ echo ccc > ccc
       
   584   $ hg commit -Am 'c_C'
       
   585   adding ccc
       
   586   $ hg topic blue
       
   587   $ echo ddd > ddd
       
   588   $ hg commit -Am 'c_D'
       
   589   adding ddd
       
   590   active topic 'blue' grew its first changeset
       
   591   $ hg up 'desc("c_B")'
       
   592   switching to topic red
       
   593   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
       
   594   $ echo eee > eee
       
   595   $ hg commit -Am 'c_E'
       
   596   adding eee
       
   597   $ echo fff > fff
       
   598   $ hg commit -Am 'c_F'
       
   599   adding fff
       
   600   $ hg topic blue
       
   601   $ echo ggg > ggg
       
   602   $ hg commit -Am 'c_G'
       
   603   adding ggg
       
   604   $ hg up 'desc("c_D")'
       
   605   2 files updated, 0 files merged, 3 files removed, 0 files unresolved
       
   606   $ hg topic red
       
   607   $ hg merge 'desc("c_G")'
       
   608   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   609   (branch merge, don't forget to commit)
       
   610   $ hg commit -Am 'c_H'
       
   611   $ hg topic blue
       
   612   $ echo iii > iii
       
   613   $ hg ci -Am 'c_I'
       
   614   adding iii
       
   615 
       
   616   $ hg log -G
       
   617   @  8 default {blue} draft c_I
       
   618   |
       
   619   o    7 default {red} draft c_H
       
   620   |\
       
   621   | o  6 default {blue} draft c_G
       
   622   | |
       
   623   | o  5 default {red} draft c_F
       
   624   | |
       
   625   | o  4 default {red} draft c_E
       
   626   | |
       
   627   o |  3 default {blue} draft c_D
       
   628   | |
       
   629   o |  2 default {red} draft c_C
       
   630   |/
       
   631   o  1 default {red} draft c_B
       
   632   |
       
   633   o  0 default {} draft c_A
       
   634   
       
   635 
       
   636   $ hg stack red
       
   637   ### topic: red
       
   638   ### target: default (branch), 6 behind
       
   639   t5: c_H
       
   640     ^ c_G
       
   641     ^ c_D
       
   642   t4: c_C
       
   643   t1^ c_B (base)
       
   644   t3: c_F
       
   645   t2: c_E
       
   646   t1: c_B
       
   647   t0^ c_A (base)
       
   648   $ hg stack blue
       
   649   ### topic: blue
       
   650   ### target: default (branch), ambigious rebase destination - topic 'blue' has 3 heads
       
   651   t3@ c_I (current)
       
   652     ^ c_H
       
   653   t2: c_D
       
   654     ^ c_C
       
   655   t1: c_G
       
   656   t0^ c_F (base)
       
   657 
       
   658 Even with some obsolete and orphan changesets
       
   659 
       
   660 (the ordering of each branch of "blue" change because their hash change. we
       
   661 should stabilize this eventuelly)
       
   662 
       
   663   $ hg up 'desc("c_B")'
       
   664   switching to topic red
       
   665   0 files updated, 0 files merged, 6 files removed, 0 files unresolved
       
   666   $ hg commit --amend --user test2
       
   667   $ hg up 'desc("c_C")'
       
   668   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   669   $ hg commit --amend --user test2
       
   670   $ hg up 'desc("c_D")'
       
   671   switching to topic blue
       
   672   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   673   $ hg commit --amend --user test2
       
   674 
       
   675   $ hg log -G --rev 'sort(all(), "topo")'
       
   676   @  11 default {blue} draft c_D
       
   677   |
       
   678   | o  8 default {blue} draft c_I
       
   679   | |
       
   680   | o    7 default {red} draft c_H
       
   681   | |\
       
   682   | | o  6 default {blue} draft c_G
       
   683   | | |
       
   684   | | o  5 default {red} draft c_F
       
   685   | | |
       
   686   | | o  4 default {red} draft c_E
       
   687   | | |
       
   688   | x |  3 default {blue} draft c_D
       
   689   |/ /
       
   690   x /  2 default {red} draft c_C
       
   691   |/
       
   692   | o  10 default {red} draft c_C
       
   693   |/
       
   694   x  1 default {red} draft c_B
       
   695   |
       
   696   | o  9 default {red} draft c_B
       
   697   |/
       
   698   o  0 default {} draft c_A
       
   699   
       
   700 
       
   701   $ hg stack red
       
   702   ### topic: red
       
   703   ### target: default (branch), ambigious rebase destination - topic 'red' has 3 heads
       
   704   t5$ c_H (unstable)
       
   705     ^ c_G
       
   706     ^ c_D
       
   707   t4$ c_C (unstable)
       
   708   t1^ c_B (base)
       
   709   t3$ c_F (unstable)
       
   710   t2$ c_E (unstable)
       
   711   t1: c_B
       
   712   t0^ c_A (base)
       
   713   $ hg stack blue
       
   714   ### topic: blue
       
   715   ### target: default (branch), ambigious rebase destination - topic 'blue' has 3 heads
       
   716   t3$ c_I (unstable)
       
   717     ^ c_H
       
   718   t2$ c_G (unstable)
       
   719     ^ c_F
       
   720   t1$ c_D (current unstable)
       
   721   t0^ c_C (base)
       
   722 
       
   723 more obsolescence
       
   724 
       
   725   $ hg up 'max(desc("c_H"))'
       
   726   switching to topic red
       
   727   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   728   $ hg commit --amend --user test3
       
   729   $ hg up 'max(desc("c_G"))'
       
   730   switching to topic blue
       
   731   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
       
   732   $ hg commit --amend --user test3
       
   733   $ hg up 'max(desc("c_B"))'
       
   734   switching to topic red
       
   735   0 files updated, 0 files merged, 3 files removed, 0 files unresolved
       
   736   $ hg commit --amend --user test3
       
   737   $ hg up 'max(desc("c_C"))'
       
   738   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   739   $ hg commit --amend --user test3
       
   740   $ hg up 'max(desc("c_D"))'
       
   741   switching to topic blue
       
   742   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   743   $ hg commit --amend --user test3
       
   744 
       
   745   $ hg log -G --rev 'sort(all(), "topo")'
       
   746   @  16 default {blue} draft c_D
       
   747   |
       
   748   | o  13 default {blue} draft c_G
       
   749   | |
       
   750   | | o    12 default {red} draft c_H
       
   751   | | |\
       
   752   | | | | o  8 default {blue} draft c_I
       
   753   | | | | |
       
   754   | | +---x  7 default {red} draft c_H
       
   755   | | | |/
       
   756   | +---x  6 default {blue} draft c_G
       
   757   | | |
       
   758   | o |  5 default {red} draft c_F
       
   759   | | |
       
   760   | o |  4 default {red} draft c_E
       
   761   | | |
       
   762   +---x  3 default {blue} draft c_D
       
   763   | |
       
   764   x |  2 default {red} draft c_C
       
   765   |/
       
   766   | o  15 default {red} draft c_C
       
   767   |/
       
   768   x  1 default {red} draft c_B
       
   769   |
       
   770   | o  14 default {red} draft c_B
       
   771   |/
       
   772   o  0 default {} draft c_A
       
   773   
       
   774 
       
   775   $ hg stack red
       
   776   ### topic: red
       
   777   ### target: default (branch), ambigious rebase destination - topic 'red' has 3 heads
       
   778   t5$ c_H (unstable)
       
   779     ^ c_G
       
   780     ^ c_D
       
   781   t4$ c_F (unstable)
       
   782   t3$ c_E (unstable)
       
   783   t1^ c_B (base)
       
   784   t2$ c_C (unstable)
       
   785   t1: c_B
       
   786   t0^ c_A (base)
       
   787   $ hg stack blue
       
   788   ### topic: blue
       
   789   ### target: default (branch), ambigious rebase destination - topic 'blue' has 3 heads
       
   790   t3$ c_I (unstable)
       
   791     ^ c_H
       
   792   t2$ c_G (unstable)
       
   793     ^ c_F
       
   794   t1$ c_D (current unstable)
       
   795   t0^ c_C (base)