##// END OF EJS Templates
templatekw: add p1/p2 keywords which switches the current ctx...
Yuya Nishihara -
r40510:539efc88 default
parent child Browse files
Show More
@@ -691,6 +691,20 b' def showsuccsandmarkers(context, mapping'
691 691
692 692 return templateutil.mappinglist(data)
693 693
694 @templatekeyword('p1', requires={'ctx'})
695 def showp1(context, mapping):
696 """Changeset. The changeset's first parent. ``{p1.rev}`` for the revision
697 number, and ``{p1.node}`` for the identification hash."""
698 ctx = context.resource(mapping, 'ctx')
699 return templateutil.mappingdict({'ctx': ctx.p1()}, tmpl=_changeidtmpl)
700
701 @templatekeyword('p2', requires={'ctx'})
702 def showp2(context, mapping):
703 """Changeset. The changeset's second parent. ``{p2.rev}`` for the revision
704 number, and ``{p2.node}`` for the identification hash."""
705 ctx = context.resource(mapping, 'ctx')
706 return templateutil.mappingdict({'ctx': ctx.p2()}, tmpl=_changeidtmpl)
707
694 708 @templatekeyword('p1rev', requires={'ctx'})
695 709 def showp1rev(context, mapping):
696 710 """Integer. The repository-local revision number of the changeset's
@@ -836,6 +836,25 b' Test index keyword:'
836 836 0 default
837 837 1 foo
838 838
839 p1/p2 keywords:
840
841 $ hg log -r4:7 -GT '{rev} p1:{p1} p2:{p2} p1.rev:{p1.rev} p2.node:{p2.node}\n'
842 o 7 p1:-1:000000000000 p2:-1:000000000000 p1.rev:-1 p2.node:0000000000000000000000000000000000000000
843
844 o 6 p1:5:13207e5a10d9 p2:4:bbe44766e73d p1.rev:5 p2.node:bbe44766e73d5f11ed2177f1838de10c53ef3e74
845 |\
846 | o 5 p1:3:10e46f2dcbf4 p2:-1:000000000000 p1.rev:3 p2.node:0000000000000000000000000000000000000000
847 | |
848 | ~
849 o 4 p1:3:10e46f2dcbf4 p2:-1:000000000000 p1.rev:3 p2.node:0000000000000000000000000000000000000000
850 |
851 ~
852
853 TODO: no idea what should be displayed as a JSON representation
854 $ hg log -r6 -T 'p1:{p1|json}\np2:{p2|json}\n'
855 p1:{}
856 p2:{}
857
839 858 ui verbosity:
840 859
841 860 $ hg log -l1 -T '{verbosity}\n'
General Comments 0
You need to be logged in to leave comments. Login now