348 cache = args['cache'] |
348 cache = args['cache'] |
349 latesttags = getlatesttags(repo, ctx, cache)[2] |
349 latesttags = getlatesttags(repo, ctx, cache)[2] |
350 |
350 |
351 return showlist('latesttag', latesttags, separator=':', **args) |
351 return showlist('latesttag', latesttags, separator=':', **args) |
352 |
352 |
|
353 def showlatesttags(pattern, **args): |
|
354 """helper method for the latesttag keyword and function""" |
|
355 repo, ctx = args['repo'], args['ctx'] |
|
356 cache = args['cache'] |
|
357 latesttags = getlatesttags(repo, ctx, cache, pattern) |
|
358 |
|
359 # latesttag[0] is an implementation detail for sorting csets on different |
|
360 # branches in a stable manner- it is the date the tagged cset was created, |
|
361 # not the date the tag was created. Therefore it isn't made visible here. |
|
362 makemap = lambda v: { |
|
363 'changes': _showchangessincetag, |
|
364 'distance': latesttags[1], |
|
365 'latesttag': v, # BC with {latesttag % '{latesttag}'} |
|
366 'tag': v |
|
367 } |
|
368 |
|
369 tags = latesttags[2] |
|
370 f = _showlist('latesttag', tags, separator=':', **args) |
|
371 return _hybrid(f, tags, makemap, lambda x: x['latesttag']) |
|
372 |
353 def showlatesttagdistance(repo, ctx, templ, cache, **args): |
373 def showlatesttagdistance(repo, ctx, templ, cache, **args): |
354 """:latesttagdistance: Integer. Longest path to the latest tag.""" |
374 """:latesttagdistance: Integer. Longest path to the latest tag.""" |
355 return getlatesttags(repo, ctx, cache)[1] |
375 return getlatesttags(repo, ctx, cache)[1] |
356 |
376 |
357 def showchangessincelatesttag(repo, ctx, templ, cache, **args): |
377 def showchangessincelatesttag(repo, ctx, templ, cache, **args): |