diff mercurial/commands.py @ 16852:af69b2b64d6e

help: format extension lists using RST This change is a move towards generating all help text as a list of strings marked up with RST.
author Olav Reinert <seroton10@gmail.com>
date Sat, 02 Jun 2012 11:22:33 +0200
parents d0fc1e689227
children 7863ff383894
line wrap: on
line diff
--- a/mercurial/commands.py	Sun Jun 03 09:06:15 2012 +0200
+++ b/mercurial/commands.py	Sat Jun 02 11:22:33 2012 +0200
@@ -3218,9 +3218,9 @@
                                              hangindent=' ' * (m + 4))))
 
         if not name:
-            text = help.listexts(_('enabled extensions:'), extensions.enabled())
-            if text:
-                ui.write("\n%s" % minirst.format(text, textwidth))
+            rst = help.listexts(_('enabled extensions:'), extensions.enabled())
+            if rst:
+                ui.write("\n%s" % minirst.format('\n'.join(rst), textwidth))
 
             ui.write(_("\nadditional help topics:\n\n"))
             topics = []
@@ -3318,12 +3318,12 @@
                                                ui.configbool('ui', 'strict'))
         doc = gettext(mod.__doc__).splitlines()[0]
 
-        msg = help.listexts(_("'%s' is provided by the following "
+        rst = help.listexts(_("'%s' is provided by the following "
                               "extension:") % cmd, {ext: doc}, indent=4)
-        ui.write(minirst.format(msg, textwidth))
-        ui.write('\n')
-        ui.write(_('use "hg help extensions" for information on enabling '
+        rst.append('\n')
+        rst.append(_('use "hg help extensions" for information on enabling '
                    'extensions\n'))
+        ui.write(minirst.format(''.join(rst), textwidth))
 
     kw = opts.get('keyword')
     if kw: