diff hgext3rd/topic/__init__.py @ 1977:137f8b04901e

topic: list the number of changesets when --verbose is used Displaying more information in the topic list is useful, we start with the most obvious: number of non-obsolete changeset in the topic.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Fri, 12 Aug 2016 23:59:37 +0200
parents ebdc2a6a9a25
children e42dd4523c0d
line wrap: on
line diff
--- a/hgext3rd/topic/__init__.py	Sun Aug 14 20:40:46 2016 +0200
+++ b/hgext3rd/topic/__init__.py	Fri Aug 12 23:59:37 2016 +0200
@@ -289,6 +289,13 @@
             fm.plain(' %s ' % marker, label=label)
         fm.write('topic', '%s', topic, label=label)
         fm.data(active=active)
+        if ui.verbose:
+            # XXX we should include the data even when not verbose
+            data = stack.stackdata(repo, topic)
+            fm.plain('\t(')
+            fm.write('changesetcount', '%d changesets', data['changesetcount'],
+                     label='topic.list.changesetcount')
+            fm.plain(')')
         fm.plain('\n')
     fm.end()