tests/test-topic-stack.t
author Pierre-Yves David <pierre-yves.david@octobus.net>
Thu, 07 Sep 2017 16:45:53 +0200
changeset 2911 8874e65343a4
parent 2805 a789b9d5b60c
child 2913 6b2ae9f2b9c4
permissions -rw-r--r--
tests: add more explicit test about empty topic from publishing
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2045
db617700d318 tests: move "test setup" script into a 'testlib' directory
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 1998
diff changeset
     1
  $ . "$TESTDIR/testlib/topic_setup.sh"
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
     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
  $ 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
    14
  $ cd main
1960
a9a1abc7dd75 test: add topic on the first 2 changesets too
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1959
diff changeset
    15
  $ hg topic other
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
    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
  $ 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
    30
  $ 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
    31
  $ 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
    32
  $ 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
    33
  $ 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
    34
  $ 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
    35
  $ 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
    36
  @  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
    37
  |
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
  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
    39
  |
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
  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
    41
  |
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
  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
    43
  |
1960
a9a1abc7dd75 test: add topic on the first 2 changesets too
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1959
diff changeset
    44
  o  1 default {other} draft c_b
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
    45
  |
1960
a9a1abc7dd75 test: add topic on the first 2 changesets too
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1959
diff changeset
    46
  o  0 default {other} draft c_a
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
    47
  
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
1961
d9c7fced94fc stack: prevent crash when topic is rooted on nullid
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1960
diff changeset
    49
Check that topic without any parent does not crash --list
d9c7fced94fc stack: prevent crash when topic is rooted on nullid
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1960
diff changeset
    50
---------------------------------------------------------
d9c7fced94fc stack: prevent crash when topic is rooted on nullid
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1960
diff changeset
    51
d9c7fced94fc stack: prevent crash when topic is rooted on nullid
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1960
diff changeset
    52
  $ hg up other
d9c7fced94fc stack: prevent crash when topic is rooted on nullid
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1960
diff changeset
    53
  switching to topic other
d9c7fced94fc stack: prevent crash when topic is rooted on nullid
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1960
diff changeset
    54
  0 files updated, 0 files merged, 4 files removed, 0 files unresolved
d9c7fced94fc stack: prevent crash when topic is rooted on nullid
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1960
diff changeset
    55
  $ hg topic --list
1995
54d6dff699f0 stack: add some header with the topic name
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 1991
diff changeset
    56
  ### topic: other
1996
5c40dd2cf131 stack: add some basic branch information
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 1995
diff changeset
    57
  ### branch: default
1961
d9c7fced94fc stack: prevent crash when topic is rooted on nullid
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1960
diff changeset
    58
  t2@ c_b (current)
d9c7fced94fc stack: prevent crash when topic is rooted on nullid
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1960
diff changeset
    59
  t1: c_a
1960
a9a1abc7dd75 test: add topic on the first 2 changesets too
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1959
diff changeset
    60
  $ hg phase --public 'topic("other")'
2911
8874e65343a4 tests: add more explicit test about empty topic from publishing
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 2805
diff changeset
    61
8874e65343a4 tests: add more explicit test about empty topic from publishing
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 2805
diff changeset
    62
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.
8874e65343a4 tests: add more explicit test about empty topic from publishing
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 2805
diff changeset
    63
8874e65343a4 tests: add more explicit test about empty topic from publishing
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 2805
diff changeset
    64
  $ hg topic
8874e65343a4 tests: add more explicit test about empty topic from publishing
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 2805
diff changeset
    65
     foo
8874e65343a4 tests: add more explicit test about empty topic from publishing
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 2805
diff changeset
    66
   * other
8874e65343a4 tests: add more explicit test about empty topic from publishing
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 2805
diff changeset
    67
  $ hg stack
8874e65343a4 tests: add more explicit test about empty topic from publishing
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 2805
diff changeset
    68
  ### topic: other
8874e65343a4 tests: add more explicit test about empty topic from publishing
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 2805
diff changeset
    69
  ### branch: 
8874e65343a4 tests: add more explicit test about empty topic from publishing
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 2805
diff changeset
    70
1961
d9c7fced94fc stack: prevent crash when topic is rooted on nullid
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1960
diff changeset
    71
  $ hg up foo
d9c7fced94fc stack: prevent crash when topic is rooted on nullid
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1960
diff changeset
    72
  switching to topic foo
d9c7fced94fc stack: prevent crash when topic is rooted on nullid
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1960
diff changeset
    73
  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1960
a9a1abc7dd75 test: add topic on the first 2 changesets too
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1959
diff changeset
    74
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
    75
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
    76
-----------
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
    77
1973
e97458bf53be stack: introduce and explicite command to display the stack
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 1961
diff changeset
    78
'hg stack' list all changeset in the topic
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
    79
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
    80
  $ 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
    81
   * foo
1973
e97458bf53be stack: introduce and explicite command to display the stack
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 1961
diff changeset
    82
  $ hg stack
1995
54d6dff699f0 stack: add some header with the topic name
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 1991
diff changeset
    83
  ### topic: foo
1996
5c40dd2cf131 stack: add some basic branch information
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 1995
diff changeset
    84
  ### branch: default
1956
d8f1e432b16a stack: reverse the display order
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1954
diff changeset
    85
  t4@ c_f (current)
d8f1e432b16a stack: reverse the display order
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1954
diff changeset
    86
  t3: c_e
1954
61f36480740f stack: start indexing at 't1' instead of 't0'
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1953
diff changeset
    87
  t2: c_d
1956
d8f1e432b16a stack: reverse the display order
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1954
diff changeset
    88
  t1: c_c
2712
f19b314d8475 topics: add t0 and b0 to the stack
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2684
diff changeset
    89
  t0^ c_b (base)
2750
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
    90
  $ hg stack -v
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
    91
  ### topic: foo
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
    92
  ### branch: default
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
    93
  t4(6559e6d93aea)@ c_f (current)
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
    94
  t3(0f9ac936c87d): c_e
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
    95
  t2(e629654d7050): c_d
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
    96
  t1(8522f9e3fee9): c_c
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
    97
  t0(ea705abc4f51)^ c_b (base)
2341
a5117a5becf8 ui: Fix hg stack json output
Boris Feld <boris.feld@octobus.net>
parents: 2045
diff changeset
    98
  $ hg stack -Tjson | python -m json.tool
a5117a5becf8 ui: Fix hg stack json output
Boris Feld <boris.feld@octobus.net>
parents: 2045
diff changeset
    99
  [
a5117a5becf8 ui: Fix hg stack json output
Boris Feld <boris.feld@octobus.net>
parents: 2045
diff changeset
   100
      {
a5117a5becf8 ui: Fix hg stack json output
Boris Feld <boris.feld@octobus.net>
parents: 2045
diff changeset
   101
          "isentry": true,
a5117a5becf8 ui: Fix hg stack json output
Boris Feld <boris.feld@octobus.net>
parents: 2045
diff changeset
   102
          "topic.stack.desc": "c_f",
a5117a5becf8 ui: Fix hg stack json output
Boris Feld <boris.feld@octobus.net>
parents: 2045
diff changeset
   103
          "topic.stack.index": 4,
2348
5737e0680f10 ui: hg topic now display if current revision is in bad state (issue5533)
Boris Feld <boris.feld@octobus.net>
parents: 2341
diff changeset
   104
          "topic.stack.state": [
5737e0680f10 ui: hg topic now display if current revision is in bad state (issue5533)
Boris Feld <boris.feld@octobus.net>
parents: 2341
diff changeset
   105
              "current"
5737e0680f10 ui: hg topic now display if current revision is in bad state (issue5533)
Boris Feld <boris.feld@octobus.net>
parents: 2341
diff changeset
   106
          ],
2341
a5117a5becf8 ui: Fix hg stack json output
Boris Feld <boris.feld@octobus.net>
parents: 2045
diff changeset
   107
          "topic.stack.state.symbol": "@"
a5117a5becf8 ui: Fix hg stack json output
Boris Feld <boris.feld@octobus.net>
parents: 2045
diff changeset
   108
      },
a5117a5becf8 ui: Fix hg stack json output
Boris Feld <boris.feld@octobus.net>
parents: 2045
diff changeset
   109
      {
a5117a5becf8 ui: Fix hg stack json output
Boris Feld <boris.feld@octobus.net>
parents: 2045
diff changeset
   110
          "isentry": true,
a5117a5becf8 ui: Fix hg stack json output
Boris Feld <boris.feld@octobus.net>
parents: 2045
diff changeset
   111
          "topic.stack.desc": "c_e",
a5117a5becf8 ui: Fix hg stack json output
Boris Feld <boris.feld@octobus.net>
parents: 2045
diff changeset
   112
          "topic.stack.index": 3,
2348
5737e0680f10 ui: hg topic now display if current revision is in bad state (issue5533)
Boris Feld <boris.feld@octobus.net>
parents: 2341
diff changeset
   113
          "topic.stack.state": [
5737e0680f10 ui: hg topic now display if current revision is in bad state (issue5533)
Boris Feld <boris.feld@octobus.net>
parents: 2341
diff changeset
   114
              "clean"
5737e0680f10 ui: hg topic now display if current revision is in bad state (issue5533)
Boris Feld <boris.feld@octobus.net>
parents: 2341
diff changeset
   115
          ],
2341
a5117a5becf8 ui: Fix hg stack json output
Boris Feld <boris.feld@octobus.net>
parents: 2045
diff changeset
   116
          "topic.stack.state.symbol": ":"
a5117a5becf8 ui: Fix hg stack json output
Boris Feld <boris.feld@octobus.net>
parents: 2045
diff changeset
   117
      },
a5117a5becf8 ui: Fix hg stack json output
Boris Feld <boris.feld@octobus.net>
parents: 2045
diff changeset
   118
      {
a5117a5becf8 ui: Fix hg stack json output
Boris Feld <boris.feld@octobus.net>
parents: 2045
diff changeset
   119
          "isentry": true,
a5117a5becf8 ui: Fix hg stack json output
Boris Feld <boris.feld@octobus.net>
parents: 2045
diff changeset
   120
          "topic.stack.desc": "c_d",
a5117a5becf8 ui: Fix hg stack json output
Boris Feld <boris.feld@octobus.net>
parents: 2045
diff changeset
   121
          "topic.stack.index": 2,
2348
5737e0680f10 ui: hg topic now display if current revision is in bad state (issue5533)
Boris Feld <boris.feld@octobus.net>
parents: 2341
diff changeset
   122
          "topic.stack.state": [
5737e0680f10 ui: hg topic now display if current revision is in bad state (issue5533)
Boris Feld <boris.feld@octobus.net>
parents: 2341
diff changeset
   123
              "clean"
5737e0680f10 ui: hg topic now display if current revision is in bad state (issue5533)
Boris Feld <boris.feld@octobus.net>
parents: 2341
diff changeset
   124
          ],
2341
a5117a5becf8 ui: Fix hg stack json output
Boris Feld <boris.feld@octobus.net>
parents: 2045
diff changeset
   125
          "topic.stack.state.symbol": ":"
a5117a5becf8 ui: Fix hg stack json output
Boris Feld <boris.feld@octobus.net>
parents: 2045
diff changeset
   126
      },
a5117a5becf8 ui: Fix hg stack json output
Boris Feld <boris.feld@octobus.net>
parents: 2045
diff changeset
   127
      {
a5117a5becf8 ui: Fix hg stack json output
Boris Feld <boris.feld@octobus.net>
parents: 2045
diff changeset
   128
          "isentry": true,
a5117a5becf8 ui: Fix hg stack json output
Boris Feld <boris.feld@octobus.net>
parents: 2045
diff changeset
   129
          "topic.stack.desc": "c_c",
a5117a5becf8 ui: Fix hg stack json output
Boris Feld <boris.feld@octobus.net>
parents: 2045
diff changeset
   130
          "topic.stack.index": 1,
2348
5737e0680f10 ui: hg topic now display if current revision is in bad state (issue5533)
Boris Feld <boris.feld@octobus.net>
parents: 2341
diff changeset
   131
          "topic.stack.state": [
5737e0680f10 ui: hg topic now display if current revision is in bad state (issue5533)
Boris Feld <boris.feld@octobus.net>
parents: 2341
diff changeset
   132
              "clean"
5737e0680f10 ui: hg topic now display if current revision is in bad state (issue5533)
Boris Feld <boris.feld@octobus.net>
parents: 2341
diff changeset
   133
          ],
2341
a5117a5becf8 ui: Fix hg stack json output
Boris Feld <boris.feld@octobus.net>
parents: 2045
diff changeset
   134
          "topic.stack.state.symbol": ":"
a5117a5becf8 ui: Fix hg stack json output
Boris Feld <boris.feld@octobus.net>
parents: 2045
diff changeset
   135
      },
a5117a5becf8 ui: Fix hg stack json output
Boris Feld <boris.feld@octobus.net>
parents: 2045
diff changeset
   136
      {
a5117a5becf8 ui: Fix hg stack json output
Boris Feld <boris.feld@octobus.net>
parents: 2045
diff changeset
   137
          "isentry": false,
a5117a5becf8 ui: Fix hg stack json output
Boris Feld <boris.feld@octobus.net>
parents: 2045
diff changeset
   138
          "topic.stack.desc": "c_b",
2712
f19b314d8475 topics: add t0 and b0 to the stack
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2684
diff changeset
   139
          "topic.stack.index": 0,
2348
5737e0680f10 ui: hg topic now display if current revision is in bad state (issue5533)
Boris Feld <boris.feld@octobus.net>
parents: 2341
diff changeset
   140
          "topic.stack.state": [
5737e0680f10 ui: hg topic now display if current revision is in bad state (issue5533)
Boris Feld <boris.feld@octobus.net>
parents: 2341
diff changeset
   141
              "base"
5737e0680f10 ui: hg topic now display if current revision is in bad state (issue5533)
Boris Feld <boris.feld@octobus.net>
parents: 2341
diff changeset
   142
          ],
2341
a5117a5becf8 ui: Fix hg stack json output
Boris Feld <boris.feld@octobus.net>
parents: 2045
diff changeset
   143
          "topic.stack.state.symbol": "^"
a5117a5becf8 ui: Fix hg stack json output
Boris Feld <boris.feld@octobus.net>
parents: 2045
diff changeset
   144
      }
a5117a5becf8 ui: Fix hg stack json output
Boris Feld <boris.feld@octobus.net>
parents: 2045
diff changeset
   145
  ]
2750
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   146
  $ hg stack -v -Tjson | python -m json.tool
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   147
  [
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   148
      {
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   149
          "isentry": true,
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   150
          "topic.stack.desc": "c_f",
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   151
          "topic.stack.index": 4,
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   152
          "topic.stack.shortnode": "6559e6d93aea",
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   153
          "topic.stack.state": [
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   154
              "current"
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   155
          ],
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   156
          "topic.stack.state.symbol": "@"
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   157
      },
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   158
      {
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   159
          "isentry": true,
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   160
          "topic.stack.desc": "c_e",
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   161
          "topic.stack.index": 3,
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   162
          "topic.stack.shortnode": "0f9ac936c87d",
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   163
          "topic.stack.state": [
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   164
              "clean"
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   165
          ],
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   166
          "topic.stack.state.symbol": ":"
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   167
      },
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   168
      {
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   169
          "isentry": true,
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   170
          "topic.stack.desc": "c_d",
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   171
          "topic.stack.index": 2,
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   172
          "topic.stack.shortnode": "e629654d7050",
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   173
          "topic.stack.state": [
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   174
              "clean"
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   175
          ],
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   176
          "topic.stack.state.symbol": ":"
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   177
      },
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   178
      {
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   179
          "isentry": true,
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   180
          "topic.stack.desc": "c_c",
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   181
          "topic.stack.index": 1,
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   182
          "topic.stack.shortnode": "8522f9e3fee9",
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   183
          "topic.stack.state": [
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   184
              "clean"
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   185
          ],
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   186
          "topic.stack.state.symbol": ":"
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   187
      },
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   188
      {
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   189
          "isentry": false,
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   190
          "topic.stack.desc": "c_b",
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   191
          "topic.stack.index": 0,
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   192
          "topic.stack.shortnode": "ea705abc4f51",
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   193
          "topic.stack.state": [
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   194
              "base"
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   195
          ],
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   196
          "topic.stack.state.symbol": "^"
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   197
      }
bd3824d1b795 stack: show short node of changesets in `hg stack -v`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2712
diff changeset
   198
  ]
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
   199
2805
a789b9d5b60c topic: make command names valid as expected, even if ui.strict=true
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 2750
diff changeset
   200
check that topics and stack are available even if ui.strict=true
a789b9d5b60c topic: make command names valid as expected, even if ui.strict=true
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 2750
diff changeset
   201
a789b9d5b60c topic: make command names valid as expected, even if ui.strict=true
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 2750
diff changeset
   202
  $ hg topics
a789b9d5b60c topic: make command names valid as expected, even if ui.strict=true
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 2750
diff changeset
   203
   * foo
a789b9d5b60c topic: make command names valid as expected, even if ui.strict=true
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 2750
diff changeset
   204
  $ hg stack
a789b9d5b60c topic: make command names valid as expected, even if ui.strict=true
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 2750
diff changeset
   205
  ### topic: foo
a789b9d5b60c topic: make command names valid as expected, even if ui.strict=true
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 2750
diff changeset
   206
  ### branch: default
a789b9d5b60c topic: make command names valid as expected, even if ui.strict=true
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 2750
diff changeset
   207
  t4@ c_f (current)
a789b9d5b60c topic: make command names valid as expected, even if ui.strict=true
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 2750
diff changeset
   208
  t3: c_e
a789b9d5b60c topic: make command names valid as expected, even if ui.strict=true
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 2750
diff changeset
   209
  t2: c_d
a789b9d5b60c topic: make command names valid as expected, even if ui.strict=true
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 2750
diff changeset
   210
  t1: c_c
a789b9d5b60c topic: make command names valid as expected, even if ui.strict=true
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 2750
diff changeset
   211
  t0^ c_b (base)
a789b9d5b60c topic: make command names valid as expected, even if ui.strict=true
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 2750
diff changeset
   212
  $ hg topics --config ui.strict=true
a789b9d5b60c topic: make command names valid as expected, even if ui.strict=true
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 2750
diff changeset
   213
   * foo
a789b9d5b60c topic: make command names valid as expected, even if ui.strict=true
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 2750
diff changeset
   214
  $ hg stack --config ui.strict=true
a789b9d5b60c topic: make command names valid as expected, even if ui.strict=true
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 2750
diff changeset
   215
  ### topic: foo
a789b9d5b60c topic: make command names valid as expected, even if ui.strict=true
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 2750
diff changeset
   216
  ### branch: default
a789b9d5b60c topic: make command names valid as expected, even if ui.strict=true
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 2750
diff changeset
   217
  t4@ c_f (current)
a789b9d5b60c topic: make command names valid as expected, even if ui.strict=true
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 2750
diff changeset
   218
  t3: c_e
a789b9d5b60c topic: make command names valid as expected, even if ui.strict=true
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 2750
diff changeset
   219
  t2: c_d
a789b9d5b60c topic: make command names valid as expected, even if ui.strict=true
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 2750
diff changeset
   220
  t1: c_c
a789b9d5b60c topic: make command names valid as expected, even if ui.strict=true
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 2750
diff changeset
   221
  t0^ c_b (base)
a789b9d5b60c topic: make command names valid as expected, even if ui.strict=true
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 2750
diff changeset
   222
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
   223
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
   224
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
   225
  $ hg topic --clear
1973
e97458bf53be stack: introduce and explicite command to display the stack
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 1961
diff changeset
   226
  $ hg stack
2684
90e11985d0cc topic: exclude public and topic changeset from branch stack
Boris Feld <boris.feld@octobus.net>
parents: 2681
diff changeset
   227
  ### branch: 
1896
4ae421cbb07c stack: exclude obsolete changeset from the set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1895
diff changeset
   228
1904
f52c02bf47b7 stack: allow to refer to changeset using "t2" form
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1898
diff changeset
   229
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
   230
-------------------
f52c02bf47b7 stack: allow to refer to changeset using "t2" form
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1898
diff changeset
   231
f52c02bf47b7 stack: allow to refer to changeset using "t2" form
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1898
diff changeset
   232
1958
62d5d4206840 stack: also change the indexing of the t# reference
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1957
diff changeset
   233
  $ hg up t2
62d5d4206840 stack: also change the indexing of the t# reference
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1957
diff changeset
   234
  abort: cannot resolve "t2": no active topic
1904
f52c02bf47b7 stack: allow to refer to changeset using "t2" form
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1898
diff changeset
   235
  [255]
f52c02bf47b7 stack: allow to refer to changeset using "t2" form
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1898
diff changeset
   236
  $ 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
   237
  $ 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
   238
  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
   239
  [255]
1958
62d5d4206840 stack: also change the indexing of the t# reference
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1957
diff changeset
   240
  $ hg up t2
1904
f52c02bf47b7 stack: allow to refer to changeset using "t2" form
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1898
diff changeset
   241
  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1958
62d5d4206840 stack: also change the indexing of the t# reference
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1957
diff changeset
   242
  $ hg summary
1960
a9a1abc7dd75 test: add topic on the first 2 changesets too
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1959
diff changeset
   243
  parent: 3:e629654d7050 
1958
62d5d4206840 stack: also change the indexing of the t# reference
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1957
diff changeset
   244
   c_d
62d5d4206840 stack: also change the indexing of the t# reference
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1957
diff changeset
   245
  branch: default
62d5d4206840 stack: also change the indexing of the t# reference
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1957
diff changeset
   246
  commit: (clean)
62d5d4206840 stack: also change the indexing of the t# reference
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1957
diff changeset
   247
  update: (current)
1960
a9a1abc7dd75 test: add topic on the first 2 changesets too
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1959
diff changeset
   248
  phases: 4 draft
1958
62d5d4206840 stack: also change the indexing of the t# reference
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1957
diff changeset
   249
  topic:  foo
1904
f52c02bf47b7 stack: allow to refer to changeset using "t2" form
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1898
diff changeset
   250
1896
4ae421cbb07c stack: exclude obsolete changeset from the set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1895
diff changeset
   251
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
   252
------------------------------------
4ae421cbb07c stack: exclude obsolete changeset from the set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1895
diff changeset
   253
4ae421cbb07c stack: exclude obsolete changeset from the set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1895
diff changeset
   254
  $ echo bbb > ddd
4ae421cbb07c stack: exclude obsolete changeset from the set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1895
diff changeset
   255
  $ hg commit --amend
4ae421cbb07c stack: exclude obsolete changeset from the set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1895
diff changeset
   256
  $ hg log -G
4ae421cbb07c stack: exclude obsolete changeset from the set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1895
diff changeset
   257
  @  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
   258
  |
4ae421cbb07c stack: exclude obsolete changeset from the set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1895
diff changeset
   259
  | 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
   260
  | |
4ae421cbb07c stack: exclude obsolete changeset from the set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1895
diff changeset
   261
  | 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
   262
  | |
4ae421cbb07c stack: exclude obsolete changeset from the set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1895
diff changeset
   263
  | 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
   264
  |/
4ae421cbb07c stack: exclude obsolete changeset from the set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1895
diff changeset
   265
  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
   266
  |
1960
a9a1abc7dd75 test: add topic on the first 2 changesets too
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1959
diff changeset
   267
  o  1 default {} public c_b
1896
4ae421cbb07c stack: exclude obsolete changeset from the set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1895
diff changeset
   268
  |
1960
a9a1abc7dd75 test: add topic on the first 2 changesets too
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1959
diff changeset
   269
  o  0 default {} public c_a
1896
4ae421cbb07c stack: exclude obsolete changeset from the set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1895
diff changeset
   270
  
4ae421cbb07c stack: exclude obsolete changeset from the set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1895
diff changeset
   271
  $ hg topic --list
1995
54d6dff699f0 stack: add some header with the topic name
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 1991
diff changeset
   272
  ### topic: foo
1996
5c40dd2cf131 stack: add some basic branch information
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 1995
diff changeset
   273
  ### branch: default
1956
d8f1e432b16a stack: reverse the display order
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1954
diff changeset
   274
  t4$ c_f (unstable)
d8f1e432b16a stack: reverse the display order
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1954
diff changeset
   275
  t3$ c_e (unstable)
1954
61f36480740f stack: start indexing at 't1' instead of 't0'
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1953
diff changeset
   276
  t2@ c_d (current)
1956
d8f1e432b16a stack: reverse the display order
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1954
diff changeset
   277
  t1: c_c
2712
f19b314d8475 topics: add t0 and b0 to the stack
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2684
diff changeset
   278
  t0^ c_b (base)
2348
5737e0680f10 ui: hg topic now display if current revision is in bad state (issue5533)
Boris Feld <boris.feld@octobus.net>
parents: 2341
diff changeset
   279
  $ hg up t3
5737e0680f10 ui: hg topic now display if current revision is in bad state (issue5533)
Boris Feld <boris.feld@octobus.net>
parents: 2341
diff changeset
   280
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
5737e0680f10 ui: hg topic now display if current revision is in bad state (issue5533)
Boris Feld <boris.feld@octobus.net>
parents: 2341
diff changeset
   281
  $ hg topic --list
5737e0680f10 ui: hg topic now display if current revision is in bad state (issue5533)
Boris Feld <boris.feld@octobus.net>
parents: 2341
diff changeset
   282
  ### topic: foo
5737e0680f10 ui: hg topic now display if current revision is in bad state (issue5533)
Boris Feld <boris.feld@octobus.net>
parents: 2341
diff changeset
   283
  ### branch: default
5737e0680f10 ui: hg topic now display if current revision is in bad state (issue5533)
Boris Feld <boris.feld@octobus.net>
parents: 2341
diff changeset
   284
  t4$ c_f (unstable)
2626
bc36a608e9e4 stack: show unstable state for the current revision if it is one (issue5553)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2348
diff changeset
   285
  t3$ c_e (current unstable)
2348
5737e0680f10 ui: hg topic now display if current revision is in bad state (issue5533)
Boris Feld <boris.feld@octobus.net>
parents: 2341
diff changeset
   286
  t2: c_d
5737e0680f10 ui: hg topic now display if current revision is in bad state (issue5533)
Boris Feld <boris.feld@octobus.net>
parents: 2341
diff changeset
   287
  t1: c_c
2712
f19b314d8475 topics: add t0 and b0 to the stack
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2684
diff changeset
   288
  t0^ c_b (base)
2348
5737e0680f10 ui: hg topic now display if current revision is in bad state (issue5533)
Boris Feld <boris.feld@octobus.net>
parents: 2341
diff changeset
   289
  $ hg topic --list --color=debug
5737e0680f10 ui: hg topic now display if current revision is in bad state (issue5533)
Boris Feld <boris.feld@octobus.net>
parents: 2341
diff changeset
   290
  [topic.stack.summary.topic|### topic: [topic.active|foo]]
5737e0680f10 ui: hg topic now display if current revision is in bad state (issue5533)
Boris Feld <boris.feld@octobus.net>
parents: 2341
diff changeset
   291
  [topic.stack.summary.branches|### branch: default]
5737e0680f10 ui: hg topic now display if current revision is in bad state (issue5533)
Boris Feld <boris.feld@octobus.net>
parents: 2341
diff changeset
   292
  [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)]
2626
bc36a608e9e4 stack: show unstable state for the current revision if it is one (issue5553)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2348
diff changeset
   293
  [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)]
2348
5737e0680f10 ui: hg topic now display if current revision is in bad state (issue5533)
Boris Feld <boris.feld@octobus.net>
parents: 2341
diff changeset
   294
  [topic.stack.index topic.stack.index.clean|t2][topic.stack.state topic.stack.state.clean|:] [topic.stack.desc topic.stack.desc.clean|c_d]
5737e0680f10 ui: hg topic now display if current revision is in bad state (issue5533)
Boris Feld <boris.feld@octobus.net>
parents: 2341
diff changeset
   295
  [topic.stack.index topic.stack.index.clean|t1][topic.stack.state topic.stack.state.clean|:] [topic.stack.desc topic.stack.desc.clean|c_c]
2712
f19b314d8475 topics: add t0 and b0 to the stack
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2684
diff changeset
   296
  [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)]
2348
5737e0680f10 ui: hg topic now display if current revision is in bad state (issue5533)
Boris Feld <boris.feld@octobus.net>
parents: 2341
diff changeset
   297
  $ hg up t2
5737e0680f10 ui: hg topic now display if current revision is in bad state (issue5533)
Boris Feld <boris.feld@octobus.net>
parents: 2341
diff changeset
   298
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1909
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   299
1910
24986e5a537c stack: add a 'stack()' revset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1909
diff changeset
   300
Also test the revset:
24986e5a537c stack: add a 'stack()' revset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1909
diff changeset
   301
24986e5a537c stack: add a 'stack()' revset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1909
diff changeset
   302
  $ hg log -r 'stack()'
24986e5a537c stack: add a 'stack()' revset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1909
diff changeset
   303
  2 default {foo} draft c_c
24986e5a537c stack: add a 'stack()' revset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1909
diff changeset
   304
  7 default {foo} draft c_d
24986e5a537c stack: add a 'stack()' revset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1909
diff changeset
   305
  4 default {foo} draft c_e
24986e5a537c stack: add a 'stack()' revset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1909
diff changeset
   306
  5 default {foo} draft c_f
24986e5a537c stack: add a 'stack()' revset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1909
diff changeset
   307
2681
aa4db71a6224 topics: return a parse error if stack() revset is passed with argument
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2670
diff changeset
   308
  $ hg log -r 'stack(foo)'
aa4db71a6224 topics: return a parse error if stack() revset is passed with argument
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2670
diff changeset
   309
  hg: parse error: stack() takes no argument, it works on current topic
aa4db71a6224 topics: return a parse error if stack() revset is passed with argument
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2670
diff changeset
   310
  [255]
aa4db71a6224 topics: return a parse error if stack() revset is passed with argument
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2670
diff changeset
   311
aa4db71a6224 topics: return a parse error if stack() revset is passed with argument
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2670
diff changeset
   312
  $ hg log -r 'stack(foobar)'
aa4db71a6224 topics: return a parse error if stack() revset is passed with argument
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2670
diff changeset
   313
  hg: parse error: stack() takes no argument, it works on current topic
aa4db71a6224 topics: return a parse error if stack() revset is passed with argument
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2670
diff changeset
   314
  [255]
aa4db71a6224 topics: return a parse error if stack() revset is passed with argument
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2670
diff changeset
   315
1909
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   316
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
   317
-------------------------------------
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   318
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   319
Make things linear again
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   320
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   321
  $ hg rebase -s 'desc(c_e)' -d 'desc(c_d) - obsolete()'
1960
a9a1abc7dd75 test: add topic on the first 2 changesets too
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1959
diff changeset
   322
  rebasing 4:0f9ac936c87d "c_e"
a9a1abc7dd75 test: add topic on the first 2 changesets too
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1959
diff changeset
   323
  rebasing 5:6559e6d93aea "c_f"
1909
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   324
  $ hg log -G
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   325
  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
   326
  |
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   327
  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
   328
  |
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   329
  @  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
   330
  |
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   331
  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
   332
  |
1960
a9a1abc7dd75 test: add topic on the first 2 changesets too
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1959
diff changeset
   333
  o  1 default {} public c_b
1909
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   334
  |
1960
a9a1abc7dd75 test: add topic on the first 2 changesets too
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1959
diff changeset
   335
  o  0 default {} public c_a
1909
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   336
  
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   337
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   338
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   339
Create the second branch
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   340
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   341
  $ 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
   342
  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
   343
  $ echo aaa > ggg
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   344
  $ hg add ggg
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   345
  $ 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
   346
  $ echo aaa > hhh
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   347
  $ hg add hhh
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   348
  $ 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
   349
  $ hg log -G
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   350
  @  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
   351
  |
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   352
  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
   353
  |
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   354
  | 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
   355
  | |
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   356
  | 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
   357
  |/
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   358
  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
   359
  |
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   360
  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
   361
  |
1960
a9a1abc7dd75 test: add topic on the first 2 changesets too
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1959
diff changeset
   362
  o  1 default {} public c_b
1909
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   363
  |
1960
a9a1abc7dd75 test: add topic on the first 2 changesets too
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1959
diff changeset
   364
  o  0 default {} public c_a
1909
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   365
  
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   366
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   367
Test output
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   368
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   369
  $ hg top -l
1998
302be26a3fd8 stack: add warning about multiple heads
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 1996
diff changeset
   370
  ### topic: foo (2 heads)
1996
5c40dd2cf131 stack: add some basic branch information
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 1995
diff changeset
   371
  ### branch: default
1956
d8f1e432b16a stack: reverse the display order
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1954
diff changeset
   372
  t6: c_f
d8f1e432b16a stack: reverse the display order
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1954
diff changeset
   373
  t5: c_e
1991
ba79d23594d6 stack: reusing the index number in base when applicable
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 1973
diff changeset
   374
  t2^ c_d (base)
1956
d8f1e432b16a stack: reverse the display order
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1954
diff changeset
   375
  t4@ c_h (current)
1954
61f36480740f stack: start indexing at 't1' instead of 't0'
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1953
diff changeset
   376
  t3: c_g
1956
d8f1e432b16a stack: reverse the display order
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1954
diff changeset
   377
  t2: c_d
d8f1e432b16a stack: reverse the display order
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1954
diff changeset
   378
  t1: c_c
2712
f19b314d8475 topics: add t0 and b0 to the stack
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2684
diff changeset
   379
  t0^ c_b (base)
1909
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   380
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   381
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
   382
---------------------------------------------------------------
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   383
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   384
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
   385
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   386
  $ 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
   387
  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
   388
  $ echo ccc > ddd
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   389
  $ 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
   390
  $ hg rebase -d . -s 'desc(c_g)'
1960
a9a1abc7dd75 test: add topic on the first 2 changesets too
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1959
diff changeset
   391
  rebasing 10:81264ae8a36a "c_g"
a9a1abc7dd75 test: add topic on the first 2 changesets too
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1959
diff changeset
   392
  rebasing 11:fde5f5941642 "c_h"
1909
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   393
  $ hg log -G
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   394
  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
   395
  |
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   396
  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
   397
  |
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   398
  @  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
   399
  |
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   400
  | 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
   401
  | |
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   402
  | 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
   403
  | |
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   404
  | 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
   405
  |/
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   406
  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
   407
  |
1960
a9a1abc7dd75 test: add topic on the first 2 changesets too
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1959
diff changeset
   408
  o  1 default {} public c_b
1909
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   409
  |
1960
a9a1abc7dd75 test: add topic on the first 2 changesets too
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1959
diff changeset
   410
  o  0 default {} public c_a
1909
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   411
  
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   412
36112e361ee4 stack: display the base of the stack
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1906
diff changeset
   413
  $ hg topic --list
1998
302be26a3fd8 stack: add warning about multiple heads
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 1996
diff changeset
   414
  ### topic: foo (2 heads)
1996
5c40dd2cf131 stack: add some basic branch information
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 1995
diff changeset
   415
  ### branch: default
1956
d8f1e432b16a stack: reverse the display order
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1954
diff changeset
   416
  t6$ c_f (unstable)
d8f1e432b16a stack: reverse the display order
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1954
diff changeset
   417
  t5$ c_e (unstable)
1991
ba79d23594d6 stack: reusing the index number in base when applicable
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 1973
diff changeset
   418
  t2^ c_D (base)
1956
d8f1e432b16a stack: reverse the display order
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1954
diff changeset
   419
  t4: c_h
1954
61f36480740f stack: start indexing at 't1' instead of 't0'
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1953
diff changeset
   420
  t3: c_g
1956
d8f1e432b16a stack: reverse the display order
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1954
diff changeset
   421
  t2@ c_D (current)
d8f1e432b16a stack: reverse the display order
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1954
diff changeset
   422
  t1: c_c
2712
f19b314d8475 topics: add t0 and b0 to the stack
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2684
diff changeset
   423
  t0^ c_b (base)
2627
42abd3bd30ee topics: abort if user wants to show the stack of a non-existent topic
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2626
diff changeset
   424
42abd3bd30ee topics: abort if user wants to show the stack of a non-existent topic
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2626
diff changeset
   425
Trying to list non existing topic
42abd3bd30ee topics: abort if user wants to show the stack of a non-existent topic
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2626
diff changeset
   426
  $ hg stack thisdoesnotexist
42abd3bd30ee topics: abort if user wants to show the stack of a non-existent topic
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2626
diff changeset
   427
  abort: cannot resolve "thisdoesnotexist": no such topic found
42abd3bd30ee topics: abort if user wants to show the stack of a non-existent topic
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2626
diff changeset
   428
  [255]
42abd3bd30ee topics: abort if user wants to show the stack of a non-existent topic
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2626
diff changeset
   429
  $ hg topic --list thisdoesnotexist
42abd3bd30ee topics: abort if user wants to show the stack of a non-existent topic
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2626
diff changeset
   430
  abort: cannot resolve "thisdoesnotexist": no such topic found
42abd3bd30ee topics: abort if user wants to show the stack of a non-existent topic
Pulkit Goyal <7895pulkit@gmail.com>
parents: 2626
diff changeset
   431
  [255]
2684
90e11985d0cc topic: exclude public and topic changeset from branch stack
Boris Feld <boris.feld@octobus.net>
parents: 2681
diff changeset
   432