# HG changeset patch # User Gregory Szorc # Date 2015-12-13 19:29:01 # Node ID c709b515218e28ea61100ec9956bca47296c7dc2 # Parent d1c998d7b1036747501d1deee8255ed9932d18e2 help: pass sub-topic into help query functions While we will likely only use this variable in helptopic(), all these functions are called with the same arguments, so we have to be consistent. diff --git a/mercurial/help.py b/mercurial/help.py --- a/mercurial/help.py +++ b/mercurial/help.py @@ -263,7 +263,7 @@ def help_(ui, name, unknowncmd=False, fu import commands # avoid cycle - def helpcmd(name): + def helpcmd(name, subtopic=None): try: aliases, entry = cmdutil.findcmd(name, commands.table, strict=unknowncmd) @@ -432,7 +432,7 @@ def help_(ui, name, unknowncmd=False, fu % (name and " " + name or "")) return rst - def helptopic(name): + def helptopic(name, subtopic=None): for names, header, doc in helptable: if name in names: break @@ -460,7 +460,7 @@ def help_(ui, name, unknowncmd=False, fu pass return rst - def helpext(name): + def helpext(name, subtopic=None): try: mod = extensions.find(name) doc = gettext(mod.__doc__) or _('no help text available') @@ -496,7 +496,7 @@ def help_(ui, name, unknowncmd=False, fu ' extensions)\n')) return rst - def helpextcmd(name): + def helpextcmd(name, subtopic=None): cmd, ext, mod = extensions.disabledcmd(ui, name, ui.configbool('ui', 'strict')) doc = gettext(mod.__doc__).splitlines()[0] @@ -545,7 +545,7 @@ def help_(ui, name, unknowncmd=False, fu queries = (helptopic, helpcmd, helpext, helpextcmd) for f in queries: try: - rst = f(name) + rst = f(name, subtopic) break except error.UnknownCommand: pass