# HG changeset patch # User epriestley # Date 1341936713 25200 # Node ID 293dd81e4601a97859d8c74f9c6b88da6411268e # Parent a3da6f298592539ebfc63855e31b6b19b670694b templatekw/help: document the {parents} keyword The {parents} keyword does not appear in the generated documentation for templates because it is added by `changeset_templater` (and this is because its behavior depends on `ui`, so it can't be defined as a normal template keyword; see comments in `changeset_templater._show()`). Add it to the documentation synthetically by creating a stub documentation function. Test plan: built the docs and examined the man page to verify that this keyword is now documented. I'm not sure how to test the i18n extraction part, but assume it will just work given that this patch doesn't do anything too crazy. diff -r a3da6f298592 -r 293dd81e4601 mercurial/help.py --- a/mercurial/help.py Sat Jul 07 00:47:55 2012 -0400 +++ b/mercurial/help.py Tue Jul 10 09:11:53 2012 -0700 @@ -199,5 +199,5 @@ addtopicsymbols('filesets', '.. predicatesmarker', fileset.symbols) addtopicsymbols('merge-tools', '.. internaltoolsmarker', filemerge.internals) addtopicsymbols('revsets', '.. predicatesmarker', revset.symbols) -addtopicsymbols('templates', '.. keywordsmarker', templatekw.keywords) +addtopicsymbols('templates', '.. keywordsmarker', templatekw.dockeywords) addtopicsymbols('templates', '.. filtersmarker', templatefilters.filters) diff -r a3da6f298592 -r 293dd81e4601 mercurial/templatekw.py --- a/mercurial/templatekw.py Sat Jul 07 00:47:55 2012 -0400 +++ b/mercurial/templatekw.py Tue Jul 10 09:11:53 2012 -0700 @@ -326,5 +326,16 @@ 'tags': showtags, } +def _showparents(**args): + """:parents: List of strings. The parents of the changeset in "rev:node" + format. If the changeset has only one "natural" parent (the predecessor + revision) nothing is shown.""" + pass + +dockeywords = { + 'parents': _showparents, +} +dockeywords.update(keywords) + # tell hggettext to extract docstrings from these functions: -i18nfunctions = keywords.values() +i18nfunctions = dockeywords.values()