##// END OF EJS Templates
templatekw: add a {negrev} keyword...
Jordi Gutiérrez Hermoso -
r41871:37b33c34 default
parent child Browse files
Show More
@@ -554,6 +554,14 b' def shownamespaces(context, mapping):'
554
554
555 return _hybrid(f, namespaces, makemap, pycompat.identity)
555 return _hybrid(f, namespaces, makemap, pycompat.identity)
556
556
557 @templatekeyword('negrev', requires={'repo', 'ctx'})
558 def shownegrev(context, mapping):
559 """Integer. The repository-local changeset negative revision number,
560 which counts in the opposite direction."""
561 ctx = context.resource(mapping, 'ctx')
562 repo = context.resource(mapping, 'repo')
563 return scmutil.intrev(ctx) - len(repo)
564
557 @templatekeyword('node', requires={'ctx'})
565 @templatekeyword('node', requires={'ctx'})
558 def shownode(context, mapping):
566 def shownode(context, mapping):
559 """String. The changeset identification hash, as a 40 hexadecimal
567 """String. The changeset identification hash, as a 40 hexadecimal
@@ -2429,6 +2429,23 b' Check other fatelog implementations'
2429 date: Thu Jan 01 00:00:00 1970 +0000
2429 date: Thu Jan 01 00:00:00 1970 +0000
2430 summary: ROOT
2430 summary: ROOT
2431
2431
2432 Check that {negrev} shows usable negative revisions despite hidden commits
2433
2434 $ hg log -G -T "{negrev}\n"
2435 @ -3
2436 |
2437 o -4
2438
2439
2440 $ hg log -G -T "{negrev}\n" --hidden
2441 x -1
2442 |
2443 | x -2
2444 |/
2445 | @ -3
2446 |/
2447 o -4
2448
2432
2449
2433 Test templates with splitted and pruned commit
2450 Test templates with splitted and pruned commit
2434 ==============================================
2451 ==============================================
@@ -2639,3 +2656,10 b' metadata should be converted back to loc'
2639 |/ Obsfate: rewritten using amend as 2:718c0d00cee1 by test (at 1970-01-01 00:00 +0000);
2656 |/ Obsfate: rewritten using amend as 2:718c0d00cee1 by test (at 1970-01-01 00:00 +0000);
2640 o ea207398892e
2657 o ea207398892e
2641
2658
2659 $ hg log -G -T "{negrev}\n"
2660 @ -1
2661 |
2662 o -2
2663 |
2664 o -5
2665
General Comments 0
You need to be logged in to leave comments. Login now