diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py --- a/mercurial/templatekw.py +++ b/mercurial/templatekw.py @@ -492,7 +492,7 @@ def showrevslist(name, revs, **args): repo = args['ctx'].repo() f = _showlist(name, revs, **args) return _hybrid(f, revs, - lambda x: {name: x, 'ctx': repo[x], 'revcache': {}}) + lambda x: {name: x, 'ctx': repo[int(x)], 'revcache': {}}) def showsubrepos(**args): """:subrepos: List of strings. Updated subrepositories in the changeset.""" 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 @@ -3310,6 +3310,13 @@ Test revset function 0 a p +a revset item must be evaluated as an integer revision, not an offset from tip + + $ hg log -l 1 -T '{revset("null") % "{rev}:{node|short}"}\n' + -1:000000000000 + $ hg log -l 1 -T '{revset("%s", "null") % "{rev}:{node|short}"}\n' + -1:000000000000 + Test active bookmark templating $ hg book foo