changeset 3372:4138771105bb

topics: list only topic names in quiet mode This will be helpful in bash completion.
author Pulkit Goyal <7895pulkit@gmail.com>
date Thu, 28 Dec 2017 04:09:02 +0530
parents 753e5ebabe7d
children 3ff0da45d4c7
files hgext3rd/topic/__init__.py tests/test-topic-stack-data.t
diffstat 2 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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