hgext3rd/topic/stack.py
changeset 2838 1c9150e30b28
parent 2750 bd3824d1b795
child 2839 f9c8c754a528
equal deleted inserted replaced
2837:cec8609bb396 2838:1c9150e30b28
     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 _
     5 from mercurial.i18n import _
     6 from mercurial import (
     6 from mercurial import (
     7     destutil,
     7     destutil,
       
     8     context,
     8     error,
     9     error,
     9     node,
    10     node,
       
    11     util,
    10 )
    12 )
    11 from .evolvebits import builddependencies, _orderrevs, _singlesuccessor
    13 from .evolvebits import builddependencies, _orderrevs, _singlesuccessor
    12 
    14 
    13 short = node.short
    15 short = node.short
       
    16 
       
    17 # TODO: compat
       
    18 
       
    19 if not util.safehasattr(context.basectx, 'orphan'):
       
    20     context.basectx.orphan = context.basectx.unstable
    14 
    21 
    15 def getstack(repo, branch=None, topic=None):
    22 def getstack(repo, branch=None, topic=None):
    16     # XXX need sorting
    23     # XXX need sorting
    17     if topic is not None and branch is not None:
    24     if topic is not None and branch is not None:
    18         raise error.ProgrammingError('both branch and topic specified (not defined yet)')
    25         raise error.ProgrammingError('both branch and topic specified (not defined yet)')
   120         if not isentry:
   127         if not isentry:
   121             symbol = '^'
   128             symbol = '^'
   122             # "base" is kind of a "ghost" entry
   129             # "base" is kind of a "ghost" entry
   123             # skip other label for them (no current, no unstable)
   130             # skip other label for them (no current, no unstable)
   124             states = ['base']
   131             states = ['base']
   125         elif ctx.unstable():
   132         elif ctx.orphan():
   126             # current revision can be unstable also, so in that case show both
   133             # current revision can be unstable also, so in that case show both
   127             # the states and the symbol '@' (issue5553)
   134             # the states and the symbol '@' (issue5553)
   128             if iscurrentrevision:
   135             if iscurrentrevision:
   129                 states.append('current')
   136                 states.append('current')
   130                 symbol = '@'
   137                 symbol = '@'