# HG changeset patch # User Benoit Boissinot # Date 1167166741 -3600 # Node ID 86098ec4b77a8596bdd8ca1f365e117ab4ce8fdc # Parent 6e0cb0790e23857bf55b7bff457c980090bd500a fix hg help for extension that do not define any command solve issue462 diff -r 6e0cb0790e23 -r 86098ec4b77a mercurial/commands.py --- 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': diff -r 6e0cb0790e23 -r 86098ec4b77a tests/test-notify --- a/tests/test-notify Tue Dec 26 21:57:20 2006 +0100 +++ b/tests/test-notify Tue Dec 26 21:59:01 2006 +0100 @@ -22,6 +22,7 @@ foo@bar = * EOF +hg help notify hg init a echo a > a/a echo % commit diff -r 6e0cb0790e23 -r 86098ec4b77a tests/test-notify.out --- a/tests/test-notify.out Tue Dec 26 21:57:20 2006 +0100 +++ b/tests/test-notify.out Tue Dec 26 21:59:01 2006 +0100 @@ -1,3 +1,6 @@ +notify extension - No help text available + +no commands defined % commit adding a % clone