hgext3rd/topic/stack.py
changeset 1977 137f8b04901e
parent 1961 d9c7fced94fc
child 1978 e42dd4523c0d
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