--- a/mercurial/commands.py Fri Jun 01 12:01:33 2012 +0200
+++ b/mercurial/commands.py Fri Jun 01 12:15:45 2012 +0200
@@ -3268,20 +3268,20 @@
else:
raise error.UnknownCommand(name)
+ rst = ["%s\n\n" % header]
# description
if not doc:
- doc = _("(no help text available)")
+ rst.append(" %s\n" % _("(no help text available)"))
if util.safehasattr(doc, '__call__'):
- doc = doc()
-
- ui.write("%s\n\n" % header)
- ui.write(minirst.format(doc, textwidth, indent=4))
+ rst += [" %s\n" % l for l in doc().splitlines()]
+
try:
cmdutil.findcmd(name, table)
- ui.write(_('\nuse "hg help -c %s" to see help for '
+ rst.append(_('\nuse "hg help -c %s" to see help for '
'the %s command\n') % (name, name))
except error.UnknownCommand:
pass
+ ui.write(minirst.format(''.join(rst), textwidth))
def helpext(name):
try: