comparison mercurial/commands.py @ 3990:96e21337dc03

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.
author Thomas Arendsen Hein <thomas@intevation.de>
date Tue, 26 Dec 2006 15:33:50 +0100
parents 356e20d46b34
children a195f11ed1a2
comparison
equal deleted inserted replaced
3989:e492ab235b4d 3990:96e21337dc03
3051 for mod, name in added: 3051 for mod, name in added:
3052 uisetup = getattr(mod, 'uisetup', None) 3052 uisetup = getattr(mod, 'uisetup', None)
3053 if uisetup: 3053 if uisetup:
3054 uisetup(ui) 3054 uisetup(ui)
3055 cmdtable = getattr(mod, 'cmdtable', {}) 3055 cmdtable = getattr(mod, 'cmdtable', {})
3056 for t in cmdtable: 3056 overrides = [cmd for cmd in cmdtable if cmd in table]
3057 if t in table: 3057 if overrides:
3058 ui.warn(_("module %s overrides %s\n") % (name, t)) 3058 ui.warn(_("extension '%s' overrides commands: %s\n")
3059 % (name, " ".join(overrides)))
3059 table.update(cmdtable) 3060 table.update(cmdtable)
3060 3061
3061 def parseconfig(config): 3062 def parseconfig(config):
3062 """parse the --config options from the command line""" 3063 """parse the --config options from the command line"""
3063 parsed = [] 3064 parsed = []