Show "(No help text available)" for commands without doc string.
authorThomas Arendsen Hein <thomas@intevation.de>
Thu, 09 Feb 2006 09:07:19 +0100
changeset 1710 c65113f3627a
parent 1709 069129d24b26
child 1711 8959700c2b19
Show "(No help text available)" for commands without doc string. Currently this only occurs with "hg help qcommit" from mq extension.
mercurial/commands.py
--- a/mercurial/commands.py	Thu Feb 09 07:24:34 2006 +0100
+++ b/mercurial/commands.py	Thu Feb 09 09:07:19 2006 +0100
@@ -405,6 +405,8 @@
 
         # description
         doc = i[0].__doc__
+        if not doc:
+            doc = _("(No help text available)")
         if ui.quiet:
             doc = doc.splitlines(0)[0]
         ui.write("%s\n" % doc.rstrip())
@@ -446,9 +448,10 @@
             if not ui.debugflag and f.startswith("debug"):
                 continue
             d = ""
-            if e[0].__doc__:
-                d = e[0].__doc__.splitlines(0)[0].rstrip()
-            h[f] = d
+            doc = e[0].__doc__
+            if not doc:
+                doc = _("(No help text available)")
+            h[f] = doc.splitlines(0)[0].rstrip()
             cmds[f] = c.lstrip("^")
 
         fns = h.keys()