Mercurial > evolve
comparison 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 |
comparison
equal
deleted
inserted
replaced
1977:137f8b04901e | 1978:e42dd4523c0d |
---|---|
66 | 66 |
67 def stackdata(repo, topic): | 67 def stackdata(repo, topic): |
68 """get various data about a stack | 68 """get various data about a stack |
69 | 69 |
70 :changesetcount: number of non-obsolete changesets in the stack | 70 :changesetcount: number of non-obsolete changesets in the stack |
71 :troubledcount: number on troubled changesets | |
71 """ | 72 """ |
72 data = {} | 73 data = {} |
73 revs = repo.revs("topic(%s) - obsolete()", topic) | 74 revs = repo.revs("topic(%s) - obsolete()", topic) |
74 data['changesetcount'] = len(revs) | 75 data['changesetcount'] = len(revs) |
76 data['troubledcount'] = len([r for r in revs if repo[r].troubled()]) | |
75 return data | 77 return data |
76 | 78 |
77 # Copied from evolve 081605c2e9b6 | 79 # Copied from evolve 081605c2e9b6 |
78 | 80 |
79 def _orderrevs(repo, revs): | 81 def _orderrevs(repo, revs): |