diff --git a/mercurial/templater.py b/mercurial/templater.py --- a/mercurial/templater.py +++ b/mercurial/templater.py @@ -578,7 +578,7 @@ def revset(context, mapping, args): return m(repo) if len(args) > 1: - formatargs = list([a[0](context, mapping, a[1]) for a in args[1:]]) + formatargs = [evalfuncarg(context, mapping, a) for a in args[1:]] revs = query(revsetmod.formatspec(raw, *formatargs)) revs = list(revs) else: 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 @@ -3305,6 +3305,9 @@ Test revset function $ hg log --template '{revset("TIP"|lower)}\n' -l1 2 + $ hg log -T '{revset("%s", "t{"ip"}")}\n' -l1 + 2 + a list template is evaluated for each item of revset/parents $ hg log -T '{rev} p: {revset("p1(%s)", rev) % "{rev}:{node|short}"}\n'