diff hgext3rd/topic/stack.py @ 1978:e42dd4523c0d

topic: list the number of troubled changesets when --verbose is used Displaying more information in the topic list is useful, we continue with the number of troubled changesets. This will help people to spot topics that needs evolution, for example after a pull.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Sat, 13 Aug 2016 01:24:10 +0200
parents 137f8b04901e
children bee7a1ef8ba8
line wrap: on
line diff
--- a/hgext3rd/topic/stack.py	Fri Aug 12 23:59:37 2016 +0200
+++ b/hgext3rd/topic/stack.py	Sat Aug 13 01:24:10 2016 +0200
@@ -68,10 +68,12 @@
     """get various data about a stack
 
     :changesetcount: number of non-obsolete changesets in the stack
+    :troubledcount: number on troubled changesets
     """
     data = {}
     revs = repo.revs("topic(%s) - obsolete()", topic)
     data['changesetcount'] = len(revs)
+    data['troubledcount'] = len([r for r in revs if repo[r].troubled()])
     return data
 
 # Copied from evolve 081605c2e9b6