comparison mercurial/filemerge.py @ 24099:be83fd9d46d5

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.
author Gregory Szorc <gregory.szorc@gmail.com>
date Mon, 09 Feb 2015 23:07:39 -0800
parents 41c03b7592ed
children 5668202cfaaf
comparison
equal deleted inserted replaced
24098:067540702f64 24099:be83fd9d46d5
19 19
20 def _toollist(ui, tool, part, default=[]): 20 def _toollist(ui, tool, part, default=[]):
21 return ui.configlist("merge-tools", tool + "." + part, default) 21 return ui.configlist("merge-tools", tool + "." + part, default)
22 22
23 internals = {} 23 internals = {}
24 # Merge tools to document.
25 internalsdoc = {}
24 26
25 def internaltool(name, trymerge, onfailure=None): 27 def internaltool(name, trymerge, onfailure=None):
26 '''return a decorator for populating internal merge tool table''' 28 '''return a decorator for populating internal merge tool table'''
27 def decorator(func): 29 def decorator(func):
28 fullname = ':' + name 30 fullname = ':' + name
29 func.__doc__ = "``%s``\n" % fullname + func.__doc__.strip() 31 func.__doc__ = "``%s``\n" % fullname + func.__doc__.strip()
30 internals[fullname] = func 32 internals[fullname] = func
31 internals['internal:' + name] = func 33 internals['internal:' + name] = func
34 internalsdoc[fullname] = func
32 func.trymerge = trymerge 35 func.trymerge = trymerge
33 func.onfailure = onfailure 36 func.onfailure = onfailure
34 return func 37 return func
35 return decorator 38 return decorator
36 39