hgext3rd/topic/stack.py
changeset 1979 bee7a1ef8ba8
parent 1978 e42dd4523c0d
child 1982 d87fc4f749e6
--- 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