help: fold some list help clauses into the helplist function
authorMatt Mackall <mpm@selenic.com>
Sat, 17 Sep 2011 14:46:00 -0500
changeset 15126 d3ad0e9d4be2
parent 15125 bdc595059108
child 15127 2c80862728cb
help: fold some list help clauses into the helplist function
mercurial/commands.py
--- a/mercurial/commands.py	Sat Sep 17 14:17:09 2011 -0500
+++ b/mercurial/commands.py	Sat Sep 17 14:46:00 2011 -0500
@@ -2848,6 +2848,19 @@
         if not ui.quiet:
             addglobalopts(True)
 
+        if not name:
+            text = help.listexts(_('enabled extensions:'), extensions.enabled())
+            if text:
+                ui.write("\n%s" % minirst.format(text, textwidth))
+
+            ui.write(_("\nadditional help topics:\n\n"))
+            topics = []
+            for names, header, doc in help.helptable:
+                topics.append((sorted(names, key=len, reverse=True)[0], header))
+            topics_len = max([len(s[0]) for s in topics])
+            for t, desc in topics:
+                ui.write(" %-*s  %s\n" % (topics_len, t, desc))
+
     def helptopic(name):
         for names, header, doc in help.helptable:
             if name in names:
@@ -2943,19 +2956,6 @@
             header = _('list of commands:\n\n')
 
         helplist(header)
-        if name != 'shortlist':
-            text = help.listexts(_('enabled extensions:'), extensions.enabled())
-            if text:
-                ui.write("\n%s" % minirst.format(text, textwidth))
-
-    if not name:
-        ui.write(_("\nadditional help topics:\n\n"))
-        topics = []
-        for names, header, doc in help.helptable:
-            topics.append((sorted(names, key=len, reverse=True)[0], header))
-        topics_len = max([len(s[0]) for s in topics])
-        for t, desc in topics:
-            ui.write(" %-*s  %s\n" % (topics_len, t, desc))
 
     ui.write(opttext(optlist, textwidth))