topics: list only topic names in quiet mode
authorPulkit Goyal <7895pulkit@gmail.com>
Thu, 28 Dec 2017 04:09:02 +0530
changeset 3372 4138771105bb
parent 3371 753e5ebabe7d
child 3373 3ff0da45d4c7
topics: list only topic names in quiet mode This will be helpful in bash completion.
hgext3rd/topic/__init__.py
tests/test-topic-stack-data.t
--- a/hgext3rd/topic/__init__.py	Wed Dec 27 23:51:18 2017 +0530
+++ b/hgext3rd/topic/__init__.py	Thu Dec 28 04:09:02 2017 +0530
@@ -903,6 +903,9 @@
         fm.write('topic', namemask, topic, label=label)
         fm.data(active=active)
 
+        if ui.quiet:
+            fm.plain('\n')
+            continue
         data = stack.stack(repo, topic=topic)
         fm.plain(' (')
         if ui.verbose:
--- a/tests/test-topic-stack-data.t	Wed Dec 27 23:51:18 2017 +0530
+++ b/tests/test-topic-stack-data.t	Thu Dec 28 04:09:02 2017 +0530
@@ -173,10 +173,10 @@
 quiet version
 
   $ hg topic --quiet
-  bar (5 changesets, 1 troubled, 2 heads)
-  baz (2 changesets)
-  foo (2 changesets)
-  fuz (3 changesets, 2 troubled)
+  bar
+  baz
+  foo
+  fuz
 
 verbose