comparison mercurial/templatekw.py @ 41129:074c72a38423

merge with stable
author Augie Fackler <augie@google.com>
date Mon, 07 Jan 2019 19:03:23 -0500
parents d11e2c5b287e 70e3e3da24be
children 66102f6fa10a
comparison
equal deleted inserted replaced
41126:d8f5c615e811 41129:074c72a38423
584 return d 584 return d
585 return _hybrid(None, urls, makemap, lambda k: '%s=%s' % (k, urls[k])) 585 return _hybrid(None, urls, makemap, lambda k: '%s=%s' % (k, urls[k]))
586 586
587 @templatekeyword("predecessors", requires={'repo', 'ctx'}) 587 @templatekeyword("predecessors", requires={'repo', 'ctx'})
588 def showpredecessors(context, mapping): 588 def showpredecessors(context, mapping):
589 """Returns the list if the closest visible successors. (EXPERIMENTAL)""" 589 """Returns the list of the closest visible successors. (EXPERIMENTAL)"""
590 repo = context.resource(mapping, 'repo') 590 repo = context.resource(mapping, 'repo')
591 ctx = context.resource(mapping, 'ctx') 591 ctx = context.resource(mapping, 'ctx')
592 predecessors = sorted(obsutil.closestpredecessors(repo, ctx.node())) 592 predecessors = sorted(obsutil.closestpredecessors(repo, ctx.node()))
593 predecessors = pycompat.maplist(hex, predecessors) 593 predecessors = pycompat.maplist(hex, predecessors)
594 594
622 return statmap.get(path) 622 return statmap.get(path)
623 623
624 @templatekeyword("successorssets", requires={'repo', 'ctx'}) 624 @templatekeyword("successorssets", requires={'repo', 'ctx'})
625 def showsuccessorssets(context, mapping): 625 def showsuccessorssets(context, mapping):
626 """Returns a string of sets of successors for a changectx. Format used 626 """Returns a string of sets of successors for a changectx. Format used
627 is: [ctx1, ctx2], [ctx3] if ctx has been splitted into ctx1 and ctx2 627 is: [ctx1, ctx2], [ctx3] if ctx has been split into ctx1 and ctx2
628 while also diverged into ctx3. (EXPERIMENTAL)""" 628 while also diverged into ctx3. (EXPERIMENTAL)"""
629 repo = context.resource(mapping, 'repo') 629 repo = context.resource(mapping, 'repo')
630 ctx = context.resource(mapping, 'ctx') 630 ctx = context.resource(mapping, 'ctx')
631 if not ctx.obsolete(): 631 if not ctx.obsolete():
632 return '' 632 return ''