comparison mercurial/templatekw.py @ 36280:48a6b1a22ccf

templatekw: add {reporoot} keyword The "%b" in filename format string will be replaced with "{reporoot|basename}".
author Yuya Nishihara <yuya@tcha.org>
date Mon, 08 Jan 2018 11:11:06 +0900
parents 230489fc0b41
children d65642840c6f
comparison
equal deleted inserted replaced
36279:9ee10b3284da 36280:48a6b1a22ccf
724 724
725 return _hybrid(None, predecessors, 725 return _hybrid(None, predecessors,
726 lambda x: {'ctx': repo[x], 'revcache': {}}, 726 lambda x: {'ctx': repo[x], 'revcache': {}},
727 lambda x: scmutil.formatchangeid(repo[x])) 727 lambda x: scmutil.formatchangeid(repo[x]))
728 728
729 @templatekeyword('reporoot')
730 def showreporoot(repo, **args):
731 """String. The root directory of the current repository."""
732 return repo.root
733
729 @templatekeyword("successorssets") 734 @templatekeyword("successorssets")
730 def showsuccessorssets(repo, ctx, **args): 735 def showsuccessorssets(repo, ctx, **args):
731 """Returns a string of sets of successors for a changectx. Format used 736 """Returns a string of sets of successors for a changectx. Format used
732 is: [ctx1, ctx2], [ctx3] if ctx has been splitted into ctx1 and ctx2 737 is: [ctx1, ctx2], [ctx3] if ctx has been splitted into ctx1 and ctx2
733 while also diverged into ctx3. (EXPERIMENTAL)""" 738 while also diverged into ctx3. (EXPERIMENTAL)"""