diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py --- a/mercurial/templatekw.py +++ b/mercurial/templatekw.py @@ -325,11 +325,15 @@ def showfiles(**args): """ return showlist('file', args['ctx'].files(), **args) -def showlatesttag(repo, ctx, templ, cache, **args): - """:latesttag: String. Most recent global tag in the ancestors of this - changeset. +def showlatesttag(**args): + """:latesttag: List of strings. The global tags on the most recent globally + tagged ancestor of this changeset. """ - return ':'.join(getlatesttags(repo, ctx, cache)[2]) + repo, ctx = args['repo'], args['ctx'] + cache = args['cache'] + latesttags = getlatesttags(repo, ctx, cache)[2] + + return showlist('latesttag', latesttags, separator=':', **args) def showlatesttagdistance(repo, ctx, templ, cache, **args): """:latesttagdistance: Integer. Longest path to the latest tag.""" diff --git a/tests/test-tag.t b/tests/test-tag.t --- a/tests/test-tag.t +++ b/tests/test-tag.t @@ -458,6 +458,9 @@ check that we can merge tags that differ $ echo c4 > f4 $ hg log -r '.' -T "{changessincelatesttag} changes since {latesttag}\n" 2 changes since t4:t6 + $ hg log -r '.' -T "{latesttag % '{latesttag}\n'}" + t4 + t6 $ hg ci -A -m4 adding f4 $ hg log -r 'wdir()' -T "{changessincelatesttag} changes since {latesttag}\n"