Mercurial > public > mercurial-scm > hg
diff mercurial/templatekw.py @ 32910: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 |
line wrap: on
line diff
--- a/mercurial/templatekw.py Sat Jun 17 13:18:03 2017 +0900 +++ b/mercurial/templatekw.py Sat Jun 17 13:23:55 2017 +0900 @@ -568,8 +568,9 @@ predecessors = sorted(obsutil.closestpredecessors(repo, ctx.node())) predecessors = map(hex, predecessors) - return _hybrid(None, predecessors, lambda x: {'node': x}, - lambda d: d['node'][:12]) + return _hybrid(None, predecessors, + lambda x: {'ctx': repo[x], 'revcache': {}}, + lambda d: short(scmutil.binnode(d['ctx']))) @templatekeyword('p1rev') def showp1rev(repo, ctx, templ, **args):