# HG changeset patch # User Yuya Nishihara # Date 1533454410 -32400 # Node ID 3cd977d5a16be12da19037d44f6468e4709007af # Parent 46f3ff64bea79695e22c1d8a018922c19a0cb776 templatekw: add {path} keyword to host documentation It's hidden since I'm not sure if filectx templates can be a thing. The plan is to add {status}, {size}, etc., which are usable within {files % ...} context. diff -r 46f3ff64bea7 -r 3cd977d5a16b mercurial/templatekw.py --- a/mercurial/templatekw.py Sun Aug 05 16:51:25 2018 +0900 +++ b/mercurial/templatekw.py Sun Aug 05 16:33:30 2018 +0900 @@ -543,6 +543,12 @@ return 'obsolete' return '' +@templatekeyword('path', requires={'fctx'}) +def showpath(context, mapping): + """String. Repository-absolute path of the current file. (EXPERIMENTAL)""" + fctx = context.resource(mapping, 'fctx') + return fctx.path() + @templatekeyword('peerurls', requires={'repo'}) def showpeerurls(context, mapping): """A dictionary of repository locations defined in the [paths] section