diff tests/test-topic.t @ 2867:5c0b6af37b21

topics: add a current flag to display current topic This patch adds a current flag which can be used by user to display the current topic.
author Pulkit Goyal <7895pulkit@gmail.com>
date Mon, 28 Aug 2017 17:15:08 +0200
parents 27ae7afd9a2a
children e46b68547017
line wrap: on
line diff
--- a/tests/test-topic.t	Mon Aug 28 17:10:41 2017 +0200
+++ b/tests/test-topic.t	Mon Aug 28 17:15:08 2017 +0200
@@ -47,6 +47,7 @@
    -r --rev REV revset of existing revisions
    -l --list    show the stack of changeset in the topic
       --age     show when you last touched the topics
+      --current display the current topic only
   
   (some details hidden, use --verbose to show complete help)
   $ hg topics
@@ -72,6 +73,15 @@
 
 Still no topics
   $ hg topics
+  $ hg topics --current
+  no active topic
+  [1]
+  $ hg topics --current somerandomtopic
+  abort: cannot use --current when setting a topic
+  [255]
+  $ hg topics --current --clear
+  abort: cannot use --current and --clear
+  [255]
 
 Test commit flag and help text
 
@@ -104,6 +114,8 @@
   $ hg topics
    * fran
      narf
+  $ hg topics --current
+  fran
   $ echo >> fran work >> beta
   $ hg ci -m 'start on fran'
   $ hg co narf