##// END OF EJS Templates
templatekw: introduce the changessincelatesttag keyword...
Matt Harbison -
r25724:4474a750 default
parent child Browse files
Show More
@@ -334,6 +334,19 b' def showlatesttagdistance(repo, ctx, tem'
334 """:latesttagdistance: Integer. Longest path to the latest tag."""
334 """:latesttagdistance: Integer. Longest path to the latest tag."""
335 return getlatesttags(repo, ctx, cache)[1]
335 return getlatesttags(repo, ctx, cache)[1]
336
336
337 def showchangessincelatesttag(repo, ctx, templ, cache, **args):
338 """:changessincelatesttag: Integer. All ancestors not in the latest tag."""
339 latesttag = getlatesttags(repo, ctx, cache)[2][0]
340 offset = 0
341 revs = [ctx.rev()]
342
343 # The only() revset doesn't currently support wdir()
344 if ctx.rev() is None:
345 offset = 1
346 revs = [p.rev() for p in ctx.parents()]
347
348 return len(repo.revs('only(%ld, %s)', revs, latesttag)) + offset
349
337 def showmanifest(**args):
350 def showmanifest(**args):
338 repo, ctx, templ = args['repo'], args['ctx'], args['templ']
351 repo, ctx, templ = args['repo'], args['ctx'], args['templ']
339 mnode = ctx.manifestnode()
352 mnode = ctx.manifestnode()
@@ -427,6 +440,7 b' keywords = {'
427 'branch': showbranch,
440 'branch': showbranch,
428 'branches': showbranches,
441 'branches': showbranches,
429 'bookmarks': showbookmarks,
442 'bookmarks': showbookmarks,
443 'changessincelatesttag': showchangessincelatesttag,
430 'children': showchildren,
444 'children': showchildren,
431 # currentbookmark is deprecated
445 # currentbookmark is deprecated
432 'currentbookmark': showcurrentbookmark,
446 'currentbookmark': showcurrentbookmark,
@@ -443,12 +443,25 b' check that we can merge tags that differ'
443 $ hg ci -A -m3
443 $ hg ci -A -m3
444 adding f3
444 adding f3
445 $ hg tag -f t4 t5 t6
445 $ hg tag -f t4 t5 t6
446
447 $ hg up -q '.^'
448 $ hg log -r 'wdir()' -T "{changessincelatesttag} changes since {latesttag}\n"
449 1 changes since t4:t5:t6
450 $ hg log -r '.' -T "{changessincelatesttag} changes since {latesttag}\n"
451 0 changes since t4:t5:t6
452 $ echo c5 > f3
453 $ hg log -r 'wdir()' -T "{changessincelatesttag} changes since {latesttag}\n"
454 1 changes since t4:t5:t6
455 $ hg up -qC
456
446 $ hg tag --remove t5
457 $ hg tag --remove t5
447 $ echo c4 > f4
458 $ echo c4 > f4
448 $ hg log -r '.' -T "{latesttag}\n"
459 $ hg log -r '.' -T "{changessincelatesttag} changes since {latesttag}\n"
449 t4:t6
460 2 changes since t4:t6
450 $ hg ci -A -m4
461 $ hg ci -A -m4
451 adding f4
462 adding f4
463 $ hg log -r 'wdir()' -T "{changessincelatesttag} changes since {latesttag}\n"
464 4 changes since t4:t6
452 $ hg tag t2
465 $ hg tag t2
453 $ hg tag -f t6
466 $ hg tag -f t6
454
467
General Comments 0
You need to be logged in to leave comments. Login now