comparison mercurial/templatekw.py @ 32928:498e9dcc5fa9

templatekw: populate all keywords depending on predecessor in map operation This is what showparents() does. repo[precnode] should never fail since its validity is tested by closestpredecessors().
author Yuya Nishihara <yuya@tcha.org>
date Sat, 17 Jun 2017 13:23:55 +0900
parents 89610c586fa2
children 7f1d07d2c8f8
comparison
equal deleted inserted replaced
32927:89610c586fa2 32928:498e9dcc5fa9
566 """Returns the list if the closest visible successors 566 """Returns the list if the closest visible successors
567 """ 567 """
568 predecessors = sorted(obsutil.closestpredecessors(repo, ctx.node())) 568 predecessors = sorted(obsutil.closestpredecessors(repo, ctx.node()))
569 predecessors = map(hex, predecessors) 569 predecessors = map(hex, predecessors)
570 570
571 return _hybrid(None, predecessors, lambda x: {'node': x}, 571 return _hybrid(None, predecessors,
572 lambda d: d['node'][:12]) 572 lambda x: {'ctx': repo[x], 'revcache': {}},
573 lambda d: short(scmutil.binnode(d['ctx'])))
573 574
574 @templatekeyword('p1rev') 575 @templatekeyword('p1rev')
575 def showp1rev(repo, ctx, templ, **args): 576 def showp1rev(repo, ctx, templ, **args):
576 """Integer. The repository-local revision number of the changeset's 577 """Integer. The repository-local revision number of the changeset's
577 first parent, or -1 if the changeset has no parents.""" 578 first parent, or -1 if the changeset has no parents."""