[PATCH 2 of 4] commands: removed unnecessary catches in around calls to help_.helplist

Henri Wiechers hwiechers at gmail.com
Tue Jan 12 02:55:22 CST 2010


# HG changeset patch
# User Henri Wiechers <hwiechers at gmail.com>
# Date 1263282073 -7200
# Node ID 127c839a5662ea733ab261bde8c0e80b9bef2df6
# Parent  76445c51851b2fb4f10a43216829a3b28cef5ad5
commands: removed unnecessary catches in around calls to help_.helplist

diff -r 76445c51851b -r 127c839a5662 mercurial/commands.py
--- a/mercurial/commands.py	Tue Jan 12 09:13:48 2010 +0200
+++ b/mercurial/commands.py	Tue Jan 12 09:41:13 2010 +0200
@@ -1485,10 +1485,7 @@
             # except block, nor can be used inside a lambda. python issue4617
             prefix = inst.args[0]
             select = lambda c: c.lstrip('^').startswith(prefix)
-            try:
-                helplist(_('list of commands:\n\n'), select)
-            except error.UnknownCommand:
-                ui.status(_('no commands defined\n'))
+            helplist(_('list of commands:\n\n'), select)
             return
 
         # check if it's an invalid alias and display its error if it is
@@ -1634,11 +1631,7 @@
         else:
             header = _('list of commands:\n\n')
 
-        try:
-            helplist(header)
-        except error.UnknownCommand:
-            ui.status(_('no commands defined\n'))
-
+        helplist(header)
         if name != 'shortlist':
             exts, maxlength = extensions.enabled()
             text = help.listexts(_('enabled extensions:'), exts, maxlength)


More information about the Mercurial-devel mailing list