tests/test-topic-stack.t
changeset 4660 b62ed7c69561
parent 4658 89c1b739fabe
child 4671 63a816beee7e
child 4704 5f90eb8fd63c
--- a/tests/test-topic-stack.t	Sat Jun 01 02:30:14 2019 +0200
+++ b/tests/test-topic-stack.t	Tue Jun 04 11:08:44 2019 +0200
@@ -107,105 +107,117 @@
   $ hg stack -Tjson | python -m json.tool
   [
       {
+          "desc": "c_f",
           "isentry": true,
-          "topic.stack.desc": "c_f",
-          "topic.stack.index": 4,
-          "topic.stack.state": [
+          "node": "6559e6d93aeadba940874f54f106c61931b5b8cf",
+          "stack_index": 4,
+          "state": [
               "current"
           ],
-          "topic.stack.state.symbol": "@"
+          "symbol": "@"
       },
       {
+          "desc": "c_e",
           "isentry": true,
-          "topic.stack.desc": "c_e",
-          "topic.stack.index": 3,
-          "topic.stack.state": [
+          "node": "0f9ac936c87d1d991011862aff4e86d0c3300a89",
+          "stack_index": 3,
+          "state": [
               "clean"
           ],
-          "topic.stack.state.symbol": ":"
+          "symbol": ":"
       },
       {
+          "desc": "c_d",
           "isentry": true,
-          "topic.stack.desc": "c_d",
-          "topic.stack.index": 2,
-          "topic.stack.state": [
+          "node": "e629654d70505107cca3d12782d9c5a50d8fb9c8",
+          "stack_index": 2,
+          "state": [
               "clean"
           ],
-          "topic.stack.state.symbol": ":"
+          "symbol": ":"
       },
       {
+          "desc": "c_c",
           "isentry": true,
-          "topic.stack.desc": "c_c",
-          "topic.stack.index": 1,
-          "topic.stack.state": [
+          "node": "8522f9e3fee92d4ec4e688ac3fbd2ee0f8fd5036",
+          "stack_index": 1,
+          "state": [
               "clean"
           ],
-          "topic.stack.state.symbol": ":"
+          "symbol": ":"
       },
       {
+          "desc": "c_b",
           "isentry": false,
-          "topic.stack.desc": "c_b",
-          "topic.stack.index": 0,
-          "topic.stack.state": [
+          "node": "ea705abc4f51e26d356ed94b3443e8c19b76cedf",
+          "stack_index": 0,
+          "state": [
               "base"
           ],
-          "topic.stack.state.symbol": "^"
+          "symbol": "^"
       }
   ]
   $ hg stack -v -Tjson | python -m json.tool
   [
       {
+          "desc": "c_f",
           "isentry": true,
-          "topic.stack.desc": "c_f",
-          "topic.stack.index": 4,
-          "topic.stack.shortnode": "6559e6d93aea",
-          "topic.stack.state": [
+          "node": "6559e6d93aeadba940874f54f106c61931b5b8cf",
+          "stack_index": 4,
+          "state": [
               "current"
           ],
-          "topic.stack.state.symbol": "@"
+          "symbol": "@"
       },
       {
+          "desc": "c_e",
           "isentry": true,
-          "topic.stack.desc": "c_e",
-          "topic.stack.index": 3,
-          "topic.stack.shortnode": "0f9ac936c87d",
-          "topic.stack.state": [
+          "node": "0f9ac936c87d1d991011862aff4e86d0c3300a89",
+          "stack_index": 3,
+          "state": [
               "clean"
           ],
-          "topic.stack.state.symbol": ":"
+          "symbol": ":"
       },
       {
+          "desc": "c_d",
           "isentry": true,
-          "topic.stack.desc": "c_d",
-          "topic.stack.index": 2,
-          "topic.stack.shortnode": "e629654d7050",
-          "topic.stack.state": [
+          "node": "e629654d70505107cca3d12782d9c5a50d8fb9c8",
+          "stack_index": 2,
+          "state": [
               "clean"
           ],
-          "topic.stack.state.symbol": ":"
+          "symbol": ":"
       },
       {
+          "desc": "c_c",
           "isentry": true,
-          "topic.stack.desc": "c_c",
-          "topic.stack.index": 1,
-          "topic.stack.shortnode": "8522f9e3fee9",
-          "topic.stack.state": [
+          "node": "8522f9e3fee92d4ec4e688ac3fbd2ee0f8fd5036",
+          "stack_index": 1,
+          "state": [
               "clean"
           ],
-          "topic.stack.state.symbol": ":"
+          "symbol": ":"
       },
       {
+          "desc": "c_b",
           "isentry": false,
-          "topic.stack.desc": "c_b",
-          "topic.stack.index": 0,
-          "topic.stack.shortnode": "ea705abc4f51",
-          "topic.stack.state": [
+          "node": "ea705abc4f51e26d356ed94b3443e8c19b76cedf",
+          "stack_index": 0,
+          "state": [
               "base"
           ],
-          "topic.stack.state.symbol": "^"
+          "symbol": "^"
       }
   ]
 
+  $ hg stack -T '{rev}: [{branch}] [{topic}] {desc}\n'
+  5: [default] [foo] c_f
+  4: [default] [foo] c_e
+  3: [default] [foo] c_d
+  2: [default] [foo] c_c
+  1: [default] [] c_b
+
 check that topics and stack are available even if ui.strict=true
 
   $ hg topics
@@ -347,13 +359,13 @@
   s1: c_c
   s0^ c_b (base)
   $ hg topic --list --color=debug
-  [topic.stack.summary.topic|### topic: [topic.active|foo]]
-  [topic.stack.summary.branches|### target: default (branch)]
-  [topic.stack.index topic.stack.index.orphan|s4][topic.stack.state topic.stack.state.orphan|$] [topic.stack.desc topic.stack.desc.orphan|c_f][topic.stack.state topic.stack.state.orphan| (orphan)]
-  [topic.stack.index topic.stack.index.current topic.stack.index.orphan|s3][topic.stack.state topic.stack.state.current topic.stack.state.orphan|@] [topic.stack.desc topic.stack.desc.current topic.stack.desc.orphan|c_e][topic.stack.state topic.stack.state.current topic.stack.state.orphan| (current orphan)]
-  [topic.stack.index topic.stack.index.clean|s2][topic.stack.state topic.stack.state.clean|:] [topic.stack.desc topic.stack.desc.clean|c_d]
-  [topic.stack.index topic.stack.index.clean|s1][topic.stack.state topic.stack.state.clean|:] [topic.stack.desc topic.stack.desc.clean|c_c]
-  [topic.stack.index topic.stack.index.base|s0][topic.stack.state topic.stack.state.base|^] [topic.stack.desc topic.stack.desc.base|c_b][topic.stack.state topic.stack.state.base| (base)]
+  [stack.summary.topic|### topic: [topic.active|foo]]
+  [stack.summary.branches|### target: default (branch)]
+  [stack.index stack.index.orphan|s4][stack.state stack.state.orphan|$] [stack.desc stack.desc.orphan|c_f][stack.state stack.state.orphan| (orphan)]
+  [stack.index stack.index.current stack.index.orphan|s3][stack.state stack.state.current stack.state.orphan|@] [stack.desc stack.desc.current stack.desc.orphan|c_e][stack.state stack.state.current stack.state.orphan| (current orphan)]
+  [stack.index stack.index.clean|s2][stack.state stack.state.clean|:] [stack.desc stack.desc.clean|c_d]
+  [stack.index stack.index.clean|s1][stack.state stack.state.clean|:] [stack.desc stack.desc.clean|c_c]
+  [stack.index stack.index.base|s0][stack.state stack.state.base|^] [stack.desc stack.desc.base|c_b][stack.state stack.state.base| (base)]
   $ hg up s2
   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
 
@@ -616,6 +628,22 @@
   s1: c_D
   s0^ c_c (base)
 
+  $ hg stack -v
+  ### topic: foobar
+  ### target: default (branch), 3 behind
+  s2(ea0f882ce093)@ c_e (current)
+                  ^ c_h
+  s1(d2f548af67ab): c_D
+  s0(8522f9e3fee9)^ c_c (base)
+
+  $ hg stack --debug
+  ### topic: foobar
+  ### target: default (branch), 3 behind
+  s2(ea0f882ce093a2ad63db49083c5cb98a24a9470e)@ c_e (current)
+                                              ^ c_h
+  s1(d2f548af67ab55b08452a3e00a539319490fcd5b): c_D
+  s0(8522f9e3fee92d4ec4e688ac3fbd2ee0f8fd5036)^ c_c (base)
+
   $ hg stack foo
   ### topic: foo
   ### target: default (branch), ambiguous rebase destination - topic 'foo' has 3 heads