# HG changeset patch # User Gregory Szorc # Date 2015-02-10 07:07:39 # Node ID be83fd9d46d50cee78dac78706b4811118a5f164 # Parent 067540702f640afdc9f09362c4a0cca3ad144951 help.merge-tools: do not double document merge tools Merge tools were being double documented in help system output due to functions being defined under multiple names in the merge tools dictionary. Establish a new dictionary for just the tools to document and use it from the help system so we don't get double output. Double documentation likely plagues other auto-documented items as well. It might be a good idea to eventually compare function instances to filter out duplicate entries from dictionaries passed to ``makeitemsdoc``. However, without an easy way to break ties, this may result in some functions being advertised over their modern equivalents. This would be a noble patch series. But it isn't one this author is willing to tackle at this time. diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py --- a/mercurial/filemerge.py +++ b/mercurial/filemerge.py @@ -21,6 +21,8 @@ def _toollist(ui, tool, part, default=[] return ui.configlist("merge-tools", tool + "." + part, default) internals = {} +# Merge tools to document. +internalsdoc = {} def internaltool(name, trymerge, onfailure=None): '''return a decorator for populating internal merge tool table''' @@ -29,6 +31,7 @@ def internaltool(name, trymerge, onfailu func.__doc__ = "``%s``\n" % fullname + func.__doc__.strip() internals[fullname] = func internals['internal:' + name] = func + internalsdoc[fullname] = func func.trymerge = trymerge func.onfailure = onfailure return func diff --git a/mercurial/help.py b/mercurial/help.py --- a/mercurial/help.py +++ b/mercurial/help.py @@ -204,7 +204,8 @@ def addtopicsymbols(topic, marker, symbo addtopichook(topic, add) addtopicsymbols('filesets', '.. predicatesmarker', fileset.symbols) -addtopicsymbols('merge-tools', '.. internaltoolsmarker', filemerge.internals) +addtopicsymbols('merge-tools', '.. internaltoolsmarker', + filemerge.internalsdoc) addtopicsymbols('revsets', '.. predicatesmarker', revset.symbols) addtopicsymbols('templates', '.. keywordsmarker', templatekw.dockeywords) addtopicsymbols('templates', '.. filtersmarker', templatefilters.filters)