##// END OF EJS Templates
templatekw: use a list of tags in getlatesttags() instead of joining them...
Matt Harbison -
r25700:0fca47b2 default
parent child Browse files
Show More
@@ -120,7 +120,7 b' def getlatesttags(repo, ctx, cache):'
120 if 'latesttags' not in cache:
120 if 'latesttags' not in cache:
121 # Cache mapping from rev to a tuple with tag date, tag
121 # Cache mapping from rev to a tuple with tag date, tag
122 # distance and tag name
122 # distance and tag name
123 cache['latesttags'] = {-1: (0, 0, 'null')}
123 cache['latesttags'] = {-1: (0, 0, ['null'])}
124 latesttags = cache['latesttags']
124 latesttags = cache['latesttags']
125
125
126 rev = ctx.rev()
126 rev = ctx.rev()
@@ -133,7 +133,7 b' def getlatesttags(repo, ctx, cache):'
133 tags = [t for t in ctx.tags()
133 tags = [t for t in ctx.tags()
134 if (repo.tagtype(t) and repo.tagtype(t) != 'local')]
134 if (repo.tagtype(t) and repo.tagtype(t) != 'local')]
135 if tags:
135 if tags:
136 latesttags[rev] = ctx.date()[0], 0, ':'.join(sorted(tags))
136 latesttags[rev] = ctx.date()[0], 0, [t for t in sorted(tags)]
137 continue
137 continue
138 try:
138 try:
139 # The tuples are laid out so the right one can be found by
139 # The tuples are laid out so the right one can be found by
@@ -328,7 +328,7 b' def showlatesttag(repo, ctx, templ, cach'
328 """:latesttag: String. Most recent global tag in the ancestors of this
328 """:latesttag: String. Most recent global tag in the ancestors of this
329 changeset.
329 changeset.
330 """
330 """
331 return getlatesttags(repo, ctx, cache)[2]
331 return ':'.join(getlatesttags(repo, ctx, cache)[2])
332
332
333 def showlatesttagdistance(repo, ctx, templ, cache, **args):
333 def showlatesttagdistance(repo, ctx, templ, cache, **args):
334 """:latesttagdistance: Integer. Longest path to the latest tag."""
334 """:latesttagdistance: Integer. Longest path to the latest tag."""
@@ -445,6 +445,8 b' check that we can merge tags that differ'
445 $ hg tag -f t4 t5 t6
445 $ hg tag -f t4 t5 t6
446 $ hg tag --remove t5
446 $ hg tag --remove t5
447 $ echo c4 > f4
447 $ echo c4 > f4
448 $ hg log -r '.' -T "{latesttag}\n"
449 t4:t6
448 $ hg ci -A -m4
450 $ hg ci -A -m4
449 adding f4
451 adding f4
450 $ hg tag t2
452 $ hg tag t2
General Comments 0
You need to be logged in to leave comments. Login now