hgext3rd/topic/stack.py
changeset 1990 71410fa2c253
parent 1988 9a5d797d25be
child 1991 ba79d23594d6
equal deleted inserted replaced
1989:cf9414f2b5cd 1990:71410fa2c253
     1 # stack.py - code related to stack workflow
     1 # stack.py - code related to stack workflow
     2 #
     2 #
     3 # This software may be used and distributed according to the terms of the
     3 # This software may be used and distributed according to the terms of the
     4 # GNU General Public License version 2 or any later version.
     4 # GNU General Public License version 2 or any later version.
     5 from mercurial.i18n import _
       
     6 from mercurial import (
     5 from mercurial import (
     7     destutil,
     6     destutil,
     8     error,
     7     error,
     9     node,
     8     node,
    10 )
     9 )
    14     # XXX need sorting
    13     # XXX need sorting
    15     trevs = repo.revs("topic(%s) - obsolete()", topic)
    14     trevs = repo.revs("topic(%s) - obsolete()", topic)
    16     return _orderrevs(repo, trevs)
    15     return _orderrevs(repo, trevs)
    17 
    16 
    18 def showstack(ui, repo, topic, opts):
    17 def showstack(ui, repo, topic, opts):
    19     if not topic:
       
    20         topic = repo.currenttopic
       
    21     if not topic:
       
    22         raise error.Abort(_('no active topic to list'))
       
    23     fm = ui.formatter('topicstack', opts)
    18     fm = ui.formatter('topicstack', opts)
    24     prev = None
    19     prev = None
    25     entries = []
    20     entries = []
    26     for idx, r in enumerate(getstack(repo, topic), 1):
    21     for idx, r in enumerate(getstack(repo, topic), 1):
    27         ctx = repo[r]
    22         ctx = repo[r]