@@ -258,17 +258,17 @@ addtopicsymbols('hgweb', '.. webcommands
def help_(ui, name, unknowncmd=False, full=True, subtopic=None, **opts):
'''
Generate the help for 'name' as unformatted restructured text. If
'name' is None, describe the commands available.
'''
import commands # avoid cycle
- def helpcmd(name):
+ def helpcmd(name, subtopic=None):
try:
aliases, entry = cmdutil.findcmd(name, commands.table,
strict=unknowncmd)
except error.AmbiguousCommand as inst:
# py3k fix: except vars can't be used outside the scope of the
# except block, nor can be used inside a lambda. python issue4617
prefix = inst.args[0]
select = lambda c: c.lstrip('^').startswith(prefix)
@@ -427,17 +427,17 @@ def help_(ui, name, unknowncmd=False, fu
rst.append(_('\n(use "hg help -v -e %s" to show built-in '
'aliases and global options)\n') % name)
else:
rst.append(_('\n(use "hg help -v%s" to show built-in aliases '
'and global options)\n')
% (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
else:
raise error.UnknownCommand(name)
rst = [minirst.section(header)]
@@ -455,17 +455,17 @@ def help_(ui, name, unknowncmd=False, fu
try:
cmdutil.findcmd(name, commands.table)
rst.append(_('\nuse "hg help -c %s" to see help for '
'the %s command\n') % (name, name))
except error.UnknownCommand:
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')
except KeyError:
mod = None
doc = extensions.disabledext(name)
if not doc:
raise error.UnknownCommand(name)
@@ -491,17 +491,17 @@ def help_(ui, name, unknowncmd=False, fu
ct = {}
modcmds = set([c.partition('|')[0] for c in ct])
rst.extend(helplist(modcmds.__contains__))
else:
rst.append(_('(use "hg help extensions" for information on enabling'
' 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]
rst = listexts(_("'%s' is provided by the following "
"extension:") % cmd, {ext: doc}, indent=4,
showdeprecated=True)
rst.append('\n')
@@ -540,17 +540,17 @@ def help_(ui, name, unknowncmd=False, fu
if opts.get('extension'):
queries += [helpext]
if opts.get('command'):
queries += [helpcmd]
if not queries:
queries = (helptopic, helpcmd, helpext, helpextcmd)
for f in queries:
try:
- rst = f(name)
+ rst = f(name, subtopic)
break
except error.UnknownCommand:
pass
else:
if unknowncmd:
raise error.UnknownCommand(name)
else:
msg = _('no such help topic: %s') % name