comparison hgext3rd/topic/stack.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 d9c7fced94fc
children e42dd4523c0d
comparison
equal deleted inserted replaced
1976:ebdc2a6a9a25 1977:137f8b04901e
61 fm.condwrite(state != 'clean' and idx is not None, 'topic.stack.state', 61 fm.condwrite(state != 'clean' and idx is not None, 'topic.stack.state',
62 ' (%s)', state, 62 ' (%s)', state,
63 label='topic.stack.state topic.stack.state.%s' % state) 63 label='topic.stack.state topic.stack.state.%s' % state)
64 fm.plain('\n') 64 fm.plain('\n')
65 fm.end() 65 fm.end()
66
67 def stackdata(repo, topic):
68 """get various data about a stack
69
70 :changesetcount: number of non-obsolete changesets in the stack
71 """
72 data = {}
73 revs = repo.revs("topic(%s) - obsolete()", topic)
74 data['changesetcount'] = len(revs)
75 return data
66 76
67 # Copied from evolve 081605c2e9b6 77 # Copied from evolve 081605c2e9b6
68 78
69 def _orderrevs(repo, revs): 79 def _orderrevs(repo, revs):
70 """Compute an ordering to solve instability for the given revs 80 """Compute an ordering to solve instability for the given revs