--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1345,13 +1345,20 @@ def help_(ui, name=None, with_version=Fa
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':
--- a/tests/test-notify
+++ b/tests/test-notify
@@ -22,6 +22,7 @@ baseurl = http://test/
foo@bar = *
EOF
+hg help notify
hg init a
echo a > a/a
echo % commit
--- a/tests/test-notify.out
+++ b/tests/test-notify.out
@@ -1,3 +1,6 @@
+notify extension - No help text available
+
+no commands defined
% commit
adding a
% clone