# HG changeset patch # User Thomas Arendsen Hein # Date 1167143630 -3600 # Node ID 96e21337dc03d34d543ea41f9f82b0cbcfe4801a # Parent e492ab235b4def0b8b7659bfe224d25660a0e0e8 Improved error message for extensions overriding commands (with test): - Old text "module foo overrides bar" was misread as overriding module bar. - Only print a single warning line per extension instead of one for each command. diff -r e492ab235b4d -r 96e21337dc03 mercurial/commands.py --- a/mercurial/commands.py Tue Dec 26 14:54:48 2006 +0100 +++ b/mercurial/commands.py Tue Dec 26 15:33:50 2006 +0100 @@ -3053,9 +3053,10 @@ if uisetup: uisetup(ui) cmdtable = getattr(mod, 'cmdtable', {}) - for t in cmdtable: - if t in table: - ui.warn(_("module %s overrides %s\n") % (name, t)) + overrides = [cmd for cmd in cmdtable if cmd in table] + if overrides: + ui.warn(_("extension '%s' overrides commands: %s\n") + % (name, " ".join(overrides))) table.update(cmdtable) def parseconfig(config): diff -r e492ab235b4d -r 96e21337dc03 tests/test-bad-extension --- a/tests/test-bad-extension Tue Dec 26 14:54:48 2006 +0100 +++ b/tests/test-bad-extension Tue Dec 26 15:33:50 2006 +0100 @@ -4,6 +4,8 @@ abspath=`pwd`/badext.py echo '[extensions]' >> $HGRCPATH +echo "gpg =" >> $HGRCPATH +echo "hgext.gpg =" >> $HGRCPATH echo "badext = $abspath" >> $HGRCPATH hg -q help help diff -r e492ab235b4d -r 96e21337dc03 tests/test-bad-extension.out --- a/tests/test-bad-extension.out Tue Dec 26 14:54:48 2006 +0100 +++ b/tests/test-bad-extension.out Tue Dec 26 15:33:50 2006 +0100 @@ -1,4 +1,5 @@ *** failed to import extension badext: invalid syntax (badext.py, line 1) +extension 'hgext.gpg' overrides commands: sigs sigcheck sign hg help [COMMAND] show help for a command, extension, or list of commands