# HG changeset patch # User Gregory Szorc # Date 1450034941 28800 # 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 -r d1c998d7b103 -r c709b515218e mercurial/help.py --- a/mercurial/help.py Sun Dec 13 11:04:45 2015 -0800 +++ b/mercurial/help.py Sun Dec 13 11:29:01 2015 -0800 @@ -263,7 +263,7 @@ 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 @@ % (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 @@ 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 @@ ' 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 @@ queries = (helptopic, helpcmd, helpext, helpextcmd) for f in queries: try: - rst = f(name) + rst = f(name, subtopic) break except error.UnknownCommand: pass