diff tests/test-topic.t @ 4074:eb4d07a0b19f mercurial-4.6

test-compat: merge stable into mercurial-4.6
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 03 Sep 2018 21:59:24 +0200
parents 299748f72527 a93b74f745a6
children dc247e648f43 e541acefbaa5
line wrap: on
line diff
--- a/tests/test-topic.t	Tue Aug 28 11:24:49 2018 +0200
+++ b/tests/test-topic.t	Mon Sep 03 21:59:24 2018 +0200
@@ -40,8 +40,10 @@
   your current topic.
   
   Topic is offering you aliases reference to changeset in your current topic
-  stack as 't#'. For example, 't1' refers to the root of your stack, 't2' to the
-  second commits, etc. The 'hg stack' command show these number.
+  stack as 's#'. For example, 's1' refers to the root of your stack, 's2' to the
+  second commits, etc. The 'hg stack' command show these number. 's0' can be
+  used to refer to the parent of the topic root. Updating using 'hg up s0' will
+  keep the topic active.
   
   Push behavior will change a bit with topic. When pushing to a publishing
   repository the changesets will turn public and the topic data on them will
@@ -271,7 +273,7 @@
   ### topic: narf
   ### target: default (branch)
   (stack is empty)
-  t0^ Add file delta (base current)
+  s0^ Add file delta (base current)
 
 Add commits to topic
 
@@ -695,7 +697,7 @@
      summary:     Add file alpha
   
 No matches because narf is already closed:
-  $ hg log -r 'topic(narf)' -G
+  $ hg log -r 'topic("narf")' -G
 This regexp should match the topic `fran`:
   $ hg log -r 'topic("re:.ra.")' -G
   o  changeset:   9:0469d521db49
@@ -735,10 +737,39 @@
   summary:     start on fran
   
 
+Using revsets in topic()
+  $ tlog() {
+  >   hg log -T '{rev}: {topic}\n' -r "$1"
+  > }
+
+  $ tlog 'topic(9)'
+  9: fran
+  $ tlog 'topic(8)'
+  $ tlog 'topic(head())'
+  9: fran
+  $ tlog 'topic(:)'
+  9: fran
+  $ tlog 'topic(all())'
+  9: fran
+  $ tlog 'topic(topic(fran))'
+  9: fran
+  $ tlog 'topic(wdir())'
+  9: fran
+  $ tlog 'topic(nonsense)'
+  abort: unknown revision 'nonsense'!
+  [255]
+
+Pattern matching in topic() revset
+  $ tlog 'topic("re:nonsense")'
+  $ tlog 'topic("literal:nonsense")'
+  abort: topic 'nonsense' does not exist!
+  [255]
+
 Deactivate the topic.
   $ hg topics
    * fran (1 changesets)
   $ hg topics --clear
+  $ hg log -r 'topic(wdir())'
   $ echo fran? >> beta
   $ hg ci -m 'fran?'
   created new head
@@ -761,7 +792,7 @@
   $ hg topics
      fran (1 changesets)
 
-Testing for updating to t0
+Testing for updating to s0
 ==========================
 
   $ hg up fran
@@ -770,10 +801,10 @@
   $ hg stack
   ### topic: fran
   ### target: default (branch), ambiguous rebase destination - branch 'default' has 2 heads
-  t1@ start on fran (current)
-  t0^ Add file delta (base)
+  s1@ start on fran (current)
+  s0^ Add file delta (base)
 
-  $ hg up t0
+  $ hg up s0
   preserving the current topic 'fran'
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
@@ -782,8 +813,8 @@
   $ hg stack
   ### topic: fran
   ### target: default (branch), ambiguous rebase destination - branch 'default' has 2 heads
-  t1: start on fran
-  t0^ Add file delta (base current)
+  s1: start on fran
+  s0^ Add file delta (base current)
 
   $ hg topics --age
    * fran (1970-01-01 by test)