tests/test-topic-stack.t
author Pierre-Yves David <pierre-yves.david@fb.com>
Mon, 14 Mar 2016 23:37:58 +0000
changeset 1909 36112e361ee4
parent 1906 5e9ce6310720
child 1910 24986e5a537c
permissions -rw-r--r--
stack: display the base of the stack Displaying the first parent of the stack seems useful. I'm even tempted to call it 't0' and have the topic still active when 'hg up t0' is used to move to the base. As a side effect we gain a way to denote that the stack is not linear. I'm not super convinced that it is the right way to display it, but this is better than no information.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1895
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     1
  $ . "$TESTDIR/testlib"
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     2
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     3
Initial setup
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     4
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     5
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     6
  $ cat << EOF >> $HGRCPATH
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     7
  > [ui]
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     8
  > logtemplate = {rev} {branch} \{{get(namespaces, "topics")}} {phase} {desc|firstline}\n
1896
4ae421cbb07c stack: exclude obsolete changeset from the set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1895
diff changeset
     9
  > [experimental]
4ae421cbb07c stack: exclude obsolete changeset from the set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1895
diff changeset
    10
  > evolution=createmarkers,exchange,allowunstable
1895
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    11
  > EOF
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    12
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    13
(new head warning seems buggy)
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    14
  $ hg init main
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    15
  $ cd main
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    16
  $ echo aaa > aaa
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    17
  $ hg add aaa
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    18
  $ hg commit -m c_a
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    19
  $ echo aaa > bbb
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    20
  $ hg add bbb
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    21
  $ hg commit -m c_b
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    22
  $ hg topic foo
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    23
  $ echo aaa > ccc
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    24
  $ hg add ccc
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    25
  $ hg commit -m c_c
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    26
  $ echo aaa > ddd
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    27
  $ hg add ddd
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    28
  $ hg commit -m c_d
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    29
  created new head
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    30
  $ echo aaa > eee
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    31
  $ hg add eee
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    32
  $ hg commit -m c_e
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    33
  created new head
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    34
  $ echo aaa > fff
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    35
  $ hg add fff
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    36
  $ hg commit -m c_f
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    37
  created new head
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    38
  $ hg log -G
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    39
  @  5 default {foo} draft c_f
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    40
  |
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    41
  o  4 default {foo} draft c_e
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    42
  |
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    43
  o  3 default {foo} draft c_d
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    44
  |
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    45
  o  2 default {foo} draft c_c
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    46
  |
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    47
  o  1 default {} draft c_b
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    48
  |
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    49
  o  0 default {} draft c_a
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    50
  
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    51
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    52
Simple test
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    53
-----------
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    54
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    55
hg topic -l list all changeset in the topic
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    56
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    57
  $ hg topic
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    58
   * foo
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    59
  $ hg topic --list
1909
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
    60
    _ c_b
1905
3b42478ef017 stack: add "t" prefix to index in the output
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1904
diff changeset
    61
  t0: c_c
3b42478ef017 stack: add "t" prefix to index in the output
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1904
diff changeset
    62
  t1: c_d
3b42478ef017 stack: add "t" prefix to index in the output
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1904
diff changeset
    63
  t2: c_e
1906
5e9ce6310720 stack: show the currently active changeset and unstable ones
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1905
diff changeset
    64
  t3@ c_f (current)
1895
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    65
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    66
error case, nothing to list
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    67
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    68
  $ hg topic --clear
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    69
  $ hg topic --list
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    70
  abort: no active topic to list
c8e4c6e03957 stack: add a very first version of stack display with 'hg topic --list'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    71
  [255]
1896
4ae421cbb07c stack: exclude obsolete changeset from the set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1895
diff changeset
    72
1904
f52c02bf47b7 stack: allow to refer to changeset using "t2" form
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1898
diff changeset
    73
Test "t#" reference
f52c02bf47b7 stack: allow to refer to changeset using "t2" form
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1898
diff changeset
    74
-------------------
f52c02bf47b7 stack: allow to refer to changeset using "t2" form
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1898
diff changeset
    75
f52c02bf47b7 stack: allow to refer to changeset using "t2" form
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1898
diff changeset
    76
f52c02bf47b7 stack: allow to refer to changeset using "t2" form
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1898
diff changeset
    77
  $ hg up t1
f52c02bf47b7 stack: allow to refer to changeset using "t2" form
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1898
diff changeset
    78
  abort: cannot resolve "t1": no active topic
f52c02bf47b7 stack: allow to refer to changeset using "t2" form
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1898
diff changeset
    79
  [255]
f52c02bf47b7 stack: allow to refer to changeset using "t2" form
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1898
diff changeset
    80
  $ hg topic foo
f52c02bf47b7 stack: allow to refer to changeset using "t2" form
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1898
diff changeset
    81
  $ hg up t42
f52c02bf47b7 stack: allow to refer to changeset using "t2" form
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1898
diff changeset
    82
  abort: cannot resolve "t42": topic "foo" has only 4 changesets
f52c02bf47b7 stack: allow to refer to changeset using "t2" form
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1898
diff changeset
    83
  [255]
f52c02bf47b7 stack: allow to refer to changeset using "t2" form
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1898
diff changeset
    84
  $ hg up t1
f52c02bf47b7 stack: allow to refer to changeset using "t2" form
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1898
diff changeset
    85
  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
f52c02bf47b7 stack: allow to refer to changeset using "t2" form
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1898
diff changeset
    86
1896
4ae421cbb07c stack: exclude obsolete changeset from the set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1895
diff changeset
    87
Case with some of the topic unstable
4ae421cbb07c stack: exclude obsolete changeset from the set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1895
diff changeset
    88
------------------------------------
4ae421cbb07c stack: exclude obsolete changeset from the set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1895
diff changeset
    89
4ae421cbb07c stack: exclude obsolete changeset from the set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1895
diff changeset
    90
  $ echo bbb > ddd
4ae421cbb07c stack: exclude obsolete changeset from the set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1895
diff changeset
    91
  $ hg commit --amend
4ae421cbb07c stack: exclude obsolete changeset from the set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1895
diff changeset
    92
  $ hg log -G
4ae421cbb07c stack: exclude obsolete changeset from the set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1895
diff changeset
    93
  @  7 default {foo} draft c_d
4ae421cbb07c stack: exclude obsolete changeset from the set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1895
diff changeset
    94
  |
4ae421cbb07c stack: exclude obsolete changeset from the set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1895
diff changeset
    95
  | o  5 default {foo} draft c_f
4ae421cbb07c stack: exclude obsolete changeset from the set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1895
diff changeset
    96
  | |
4ae421cbb07c stack: exclude obsolete changeset from the set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1895
diff changeset
    97
  | o  4 default {foo} draft c_e
4ae421cbb07c stack: exclude obsolete changeset from the set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1895
diff changeset
    98
  | |
4ae421cbb07c stack: exclude obsolete changeset from the set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1895
diff changeset
    99
  | x  3 default {foo} draft c_d
4ae421cbb07c stack: exclude obsolete changeset from the set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1895
diff changeset
   100
  |/
4ae421cbb07c stack: exclude obsolete changeset from the set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1895
diff changeset
   101
  o  2 default {foo} draft c_c
4ae421cbb07c stack: exclude obsolete changeset from the set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1895
diff changeset
   102
  |
4ae421cbb07c stack: exclude obsolete changeset from the set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1895
diff changeset
   103
  o  1 default {} draft c_b
4ae421cbb07c stack: exclude obsolete changeset from the set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1895
diff changeset
   104
  |
4ae421cbb07c stack: exclude obsolete changeset from the set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1895
diff changeset
   105
  o  0 default {} draft c_a
4ae421cbb07c stack: exclude obsolete changeset from the set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1895
diff changeset
   106
  
4ae421cbb07c stack: exclude obsolete changeset from the set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1895
diff changeset
   107
  $ hg topic --list
1909
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   108
    _ c_b
1905
3b42478ef017 stack: add "t" prefix to index in the output
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1904
diff changeset
   109
  t0: c_c
1906
5e9ce6310720 stack: show the currently active changeset and unstable ones
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1905
diff changeset
   110
  t1@ c_d (current)
5e9ce6310720 stack: show the currently active changeset and unstable ones
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1905
diff changeset
   111
  t2$ c_e (unstable)
5e9ce6310720 stack: show the currently active changeset and unstable ones
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1905
diff changeset
   112
  t3$ c_f (unstable)
1909
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   113
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   114
Case with multiple heads on the topic
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   115
-------------------------------------
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   116
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   117
Make things linear again
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   118
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   119
  $ hg rebase -s 'desc(c_e)' -d 'desc(c_d) - obsolete()'
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   120
  rebasing 4:91fa8808d101 "c_e"
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   121
  rebasing 5:4ec5094907b7 "c_f"
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   122
  $ hg log -G
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   123
  o  9 default {foo} draft c_f
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   124
  |
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   125
  o  8 default {foo} draft c_e
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   126
  |
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   127
  @  7 default {foo} draft c_d
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   128
  |
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   129
  o  2 default {foo} draft c_c
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   130
  |
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   131
  o  1 default {} draft c_b
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   132
  |
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   133
  o  0 default {} draft c_a
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   134
  
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   135
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   136
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   137
Create the second branch
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   138
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   139
  $ hg up 'desc(c_d)'
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   140
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   141
  $ echo aaa > ggg
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   142
  $ hg add ggg
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   143
  $ hg commit -m c_g
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   144
  created new head
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   145
  $ echo aaa > hhh
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   146
  $ hg add hhh
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   147
  $ hg commit -m c_h
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   148
  created new head
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   149
  $ hg log -G
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   150
  @  11 default {foo} draft c_h
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   151
  |
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   152
  o  10 default {foo} draft c_g
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   153
  |
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   154
  | o  9 default {foo} draft c_f
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   155
  | |
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   156
  | o  8 default {foo} draft c_e
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   157
  |/
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   158
  o  7 default {foo} draft c_d
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   159
  |
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   160
  o  2 default {foo} draft c_c
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   161
  |
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   162
  o  1 default {} draft c_b
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   163
  |
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   164
  o  0 default {} draft c_a
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   165
  
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   166
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   167
Test output
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   168
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   169
  $ hg top -l
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   170
    _ c_b
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   171
  t0: c_c
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   172
  t1: c_d
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   173
  t2: c_g
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   174
  t3@ c_h (current)
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   175
    _ c_d
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   176
  t4: c_e
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   177
  t5: c_f
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   178
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   179
Case with multiple heads on the topic with unstability involved
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   180
---------------------------------------------------------------
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   181
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   182
We amend the message to make sure the display base pick the right changeset
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   183
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   184
  $ hg up 'desc(c_d)'
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   185
  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   186
  $ echo ccc > ddd
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   187
  $ hg commit --amend -m 'c_D' 
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   188
  $ hg rebase -d . -s 'desc(c_g)'
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   189
  rebasing 10:11286b4fcb3d "c_g"
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   190
  rebasing 11:3ad57527186d "c_h"
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   191
  $ hg log -G
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   192
  o  15 default {foo} draft c_h
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   193
  |
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   194
  o  14 default {foo} draft c_g
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   195
  |
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   196
  @  13 default {foo} draft c_D
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   197
  |
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   198
  | o  9 default {foo} draft c_f
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   199
  | |
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   200
  | o  8 default {foo} draft c_e
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   201
  | |
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   202
  | x  7 default {foo} draft c_d
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   203
  |/
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   204
  o  2 default {foo} draft c_c
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   205
  |
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   206
  o  1 default {} draft c_b
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   207
  |
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   208
  o  0 default {} draft c_a
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   209
  
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   210
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   211
  $ hg topic --list
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   212
    _ c_b
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   213
  t0: c_c
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   214
  t1@ c_D (current)
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   215
  t2: c_g
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   216
  t3: c_h
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   217
    _ c_D
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   218
  t4$ c_e (unstable)
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   219
  t5$ c_f (unstable)