hgext3rd/topic/stack.py
changeset 3371 753e5ebabe7d
parent 3278 e4c0332ecee4
child 4067 fb4801478d5d
equal deleted inserted replaced
3370:1face8964965 3371:753e5ebabe7d
    25 if not util.safehasattr(context.basectx, 'orphan'):
    25 if not util.safehasattr(context.basectx, 'orphan'):
    26     context.basectx.orphan = context.basectx.unstable
    26     context.basectx.orphan = context.basectx.unstable
    27 
    27 
    28 if not util.safehasattr(context.basectx, 'isunstable'):
    28 if not util.safehasattr(context.basectx, 'isunstable'):
    29     context.basectx.isunstable = context.basectx.troubled
    29     context.basectx.isunstable = context.basectx.troubled
       
    30 
       
    31 def parseusername(user):
       
    32     """parses the ctx user and returns the username without email ID if
       
    33     possible, otherwise returns the mail address from that"""
       
    34     username = None
       
    35     if user:
       
    36         # user is of form "abc <abc@xyz.com>"
       
    37         username = user.split('<')[0]
       
    38         if not username:
       
    39             # assuming user is of form "<abc@xyz.com>"
       
    40             if len(user) > 1:
       
    41                 username = user[1:-1]
       
    42             else:
       
    43                 username = user
       
    44         username = username.strip()
       
    45 
       
    46     return username
    30 
    47 
    31 def _stackcandidates(repo):
    48 def _stackcandidates(repo):
    32     """build the smaller set of revs that might be part of a stack.
    49     """build the smaller set of revs that might be part of a stack.
    33 
    50 
    34     The intend is to build something more efficient than what revsets do in
    51     The intend is to build something more efficient than what revsets do in