Mercurial > public > mercurial-scm > hg-stable
diff mercurial/templatekw.py @ 30712:5dde81de1e6d
templatekw: add a "troubles" template keyword
The "troubles" template keyword returns a list of evolution troubles.
It is EXPERIMENTAL, as anything else related to changeset evolution.
Test it in test-obsolete.t which has troubled changesets.
author | Denis Laxalde <denis.laxalde@logilab.fr> |
---|---|
date | Fri, 06 Jan 2017 13:50:16 +0100 |
parents | 11b8b740d54a |
children | cf1e15f91c90 |
line wrap: on
line diff
--- a/mercurial/templatekw.py Fri Jan 06 15:48:22 2017 +0100 +++ b/mercurial/templatekw.py Fri Jan 06 13:50:16 2017 +0100 @@ -595,5 +595,13 @@ """Integer. The width of the current terminal.""" return repo.ui.termwidth() +@templatekeyword('troubles') +def showtroubles(**args): + """List of strings. Evolution troubles affecting the changeset. + + (EXPERIMENTAL) + """ + return showlist('trouble', args['ctx'].troubles(), **args) + # tell hggettext to extract docstrings from these functions: i18nfunctions = keywords.values()