mercurial/commands.py
changeset 4009 86098ec4b77a
parent 3915 3c82ab166eea
child 4010 e282448d68f1
--- a/mercurial/commands.py	Tue Dec 26 21:57:20 2006 +0100
+++ b/mercurial/commands.py	Tue Dec 26 21:59:01 2006 +0100
@@ -1345,13 +1345,20 @@
             ui.write(d, '\n')
 
         ui.status('\n')
+
+        try:
+            ct = mod.cmdtable
+        except AttributeError:
+            ui.status(_('no commands defined\n'))
+            return
+
         if ui.verbose:
             ui.status(_('list of commands:\n\n'))
         else:
             ui.status(_('list of commands (use "hg help -v %s" '
                         'to show aliases and global options):\n\n') % name)
 
-        modcmds = dict.fromkeys([c.split('|', 1)[0] for c in mod.cmdtable])
+        modcmds = dict.fromkeys([c.split('|', 1)[0] for c in ct])
         helplist(modcmds.has_key)
 
     if name and name != 'shortlist':