hgext3rd/topic/stack.py
branchmercurial-4.8
changeset 4356 a71f2271ed76
parent 4285 69fb9e41ce2b
child 4429 e10ebc58926e
equal deleted inserted replaced
4355:75db6a9d0b54 4356:a71f2271ed76
   327     # super crude initial version
   327     # super crude initial version
   328     for idx, isentry, ctx in entries[::-1]:
   328     for idx, isentry, ctx in entries[::-1]:
   329 
   329 
   330         symbol = None
   330         symbol = None
   331         states = []
   331         states = []
       
   332         msg = ''
   332         iscurrentrevision = repo.revs('%d and parents()', ctx.rev())
   333         iscurrentrevision = repo.revs('%d and parents()', ctx.rev())
       
   334         if opts.get('children'):
       
   335             if branch:
       
   336                 t_msg = '-branch("%s")' % branch
       
   337             if topic:
       
   338                 t_msg = '-topic("%s")' % topic
       
   339             rev_msg = 'children(%s) and merge() %s'
       
   340             revisions = repo.revs(rev_msg % (ctx.rev(), t_msg))
       
   341             len_rev = len(revisions)
       
   342             if len_rev > 0:
       
   343                 msg = 'external-children'
   333 
   344 
   334         if iscurrentrevision:
   345         if iscurrentrevision:
   335             states.append('current')
       
   336             symbol = '@'
   346             symbol = '@'
       
   347             if msg:
       
   348                 states.append('current - ' + msg)
       
   349             else:
       
   350                 states.append('current')
   337 
   351 
   338         if ctx.orphan():
   352         if ctx.orphan():
   339             symbol = '$'
   353             symbol = '$'
   340             states.append('unstable')
   354             if msg:
       
   355                 states.append('unstable - ' + msg)
       
   356             else:
       
   357                 states.append('unstable')
   341 
   358 
   342         if not isentry:
   359         if not isentry:
   343             symbol = '^'
   360             symbol = '^'
   344             # "base" is kind of a "ghost" entry
   361             # "base" is kind of a "ghost" entry
   345             states.append('base')
   362             states.append('base')
   346 
   363 
   347         # none of the above if statments get executed
   364         # none of the above if statments get executed
   348         if not symbol:
   365         if not symbol:
   349             symbol = ':'
   366             symbol = ':'
   350             states.append('clean')
   367             if msg:
       
   368                 states.append(msg)
       
   369             else:
       
   370                 states.append('clean')
   351 
   371 
   352         states.sort()
   372         states.sort()
   353 
   373 
   354         fm.startitem()
   374         fm.startitem()
   355         fm.data(isentry=isentry)
   375         fm.data(isentry=isentry)