##// END OF EJS Templates
templatekw: make negrev return empty for wdir() and nullrev...
Jordi Gutiérrez Hermoso -
r41875:36b62a52 default
parent child Browse files
Show More
@@ -559,8 +559,11 b' def shownegrev(context, mapping):'
559 """Integer. The repository-local changeset negative revision number,
559 """Integer. The repository-local changeset negative revision number,
560 which counts in the opposite direction."""
560 which counts in the opposite direction."""
561 ctx = context.resource(mapping, 'ctx')
561 ctx = context.resource(mapping, 'ctx')
562 rev = ctx.rev()
563 if rev is None or rev < 0: # wdir() or nullrev?
564 return None
562 repo = context.resource(mapping, 'repo')
565 repo = context.resource(mapping, 'repo')
563 return scmutil.intrev(ctx) - len(repo)
566 return rev - len(repo)
564
567
565 @templatekeyword('node', requires={'ctx'})
568 @templatekeyword('node', requires={'ctx'})
566 def shownode(context, mapping):
569 def shownode(context, mapping):
@@ -76,6 +76,12 b' experimental:'
76 $ hg log -r 'wdir()' -T '{manifest}\n'
76 $ hg log -r 'wdir()' -T '{manifest}\n'
77 2147483647:ffffffffffff
77 2147483647:ffffffffffff
78
78
79 However, for negrev, we refuse to output anything (as well as for null)
80
81 $ hg log -r 'wdir() + null' -T 'bla{negrev}nk\n'
82 blank
83 blank
84
79 Changectx-derived keywords are disabled within {manifest} as {node} changes:
85 Changectx-derived keywords are disabled within {manifest} as {node} changes:
80
86
81 $ hg log -r0 -T 'outer:{p1node} {manifest % "inner:{p1node}"}\n'
87 $ hg log -r0 -T 'outer:{p1node} {manifest % "inner:{p1node}"}\n'
General Comments 0
You need to be logged in to leave comments. Login now