diff hgext3rd/topic/stack.py @ 1979:bee7a1ef8ba8

topic: list the number of head when --verbose is used Displaying more information in the topic list is useful, we continue with the number of heads on the topics, this will help highlight the problem to users. We only display head if there is more than one.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Sun, 14 Aug 2016 19:40:53 +0200
parents e42dd4523c0d
children d87fc4f749e6
line wrap: on
line diff
--- a/hgext3rd/topic/stack.py	Sat Aug 13 01:24:10 2016 +0200
+++ b/hgext3rd/topic/stack.py	Sun Aug 14 19:40:53 2016 +0200
@@ -69,11 +69,15 @@
 
     :changesetcount: number of non-obsolete changesets in the stack
     :troubledcount: number on troubled changesets
+    :headcount: number of heads on the topic
     """
     data = {}
     revs = repo.revs("topic(%s) - obsolete()", topic)
     data['changesetcount'] = len(revs)
     data['troubledcount'] = len([r for r in revs if repo[r].troubled()])
+    deps, rdeps = builddependencies(repo, revs)
+    data['headcount'] = len([r for r in revs if not rdeps[r]])
+
     return data
 
 # Copied from evolve 081605c2e9b6