Skip to content
Snippets Groups Projects
Commit 293dd81e authored by epriestley's avatar epriestley
Browse files

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.
parent a3da6f29
No related branches found
No related tags found
No related merge requests found
...@@ -199,5 +199,5 @@ ...@@ -199,5 +199,5 @@
addtopicsymbols('filesets', '.. predicatesmarker', fileset.symbols) addtopicsymbols('filesets', '.. predicatesmarker', fileset.symbols)
addtopicsymbols('merge-tools', '.. internaltoolsmarker', filemerge.internals) addtopicsymbols('merge-tools', '.. internaltoolsmarker', filemerge.internals)
addtopicsymbols('revsets', '.. predicatesmarker', revset.symbols) addtopicsymbols('revsets', '.. predicatesmarker', revset.symbols)
addtopicsymbols('templates', '.. keywordsmarker', templatekw.keywords) addtopicsymbols('templates', '.. keywordsmarker', templatekw.dockeywords)
addtopicsymbols('templates', '.. filtersmarker', templatefilters.filters) addtopicsymbols('templates', '.. filtersmarker', templatefilters.filters)
...@@ -326,4 +326,15 @@ ...@@ -326,4 +326,15 @@
'tags': showtags, '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: # tell hggettext to extract docstrings from these functions:
...@@ -329,2 +340,2 @@ ...@@ -329,2 +340,2 @@
# tell hggettext to extract docstrings from these functions: # tell hggettext to extract docstrings from these functions:
i18nfunctions = keywords.values() i18nfunctions = dockeywords.values()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment