# HG changeset patch # User Yuya Nishihara # Date 2016-07-22 13:00:46 # Node ID 33bf8bd8c5b94c573f010c458a579b1f411e1016 # Parent 9c2cc107547fd701a7604349632f2f590366f17c templatekw: fix join format of revset() function It's been broken since e4609ec959f8, which made makemap() return a dict of multiple keywords. Because the default joinfmt() randomly picks one item from a dict, we have to make revset() select d[name] explicitly. diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py --- a/mercurial/templatekw.py +++ b/mercurial/templatekw.py @@ -547,7 +547,8 @@ def showrevslist(name, revs, **args): revs = [str(r) for r in revs] # ifcontains() needs a list of str f = _showlist(name, revs, **args) return _hybrid(f, revs, - lambda x: {name: x, 'ctx': repo[int(x)], 'revcache': {}}) + lambda x: {name: x, 'ctx': repo[int(x)], 'revcache': {}}, + lambda d: d[name]) @templatekeyword('subrepos') def showsubrepos(**args): diff --git a/tests/test-command-template.t b/tests/test-command-template.t --- a/tests/test-command-template.t +++ b/tests/test-command-template.t @@ -3433,6 +3433,11 @@ a revset item must be evaluated as an in $ hg log -l 1 -T '{revset("%s", "null") % "{rev}:{node|short}"}\n' -1:000000000000 +join() should pick '{rev}' from revset items: + + $ hg log -R ../a -T '{join(revset("parents(%d)", rev), ", ")}\n' -r6 + 4, 5 + Test active bookmark templating $ hg book foo