diff --git a/hgext/color.py b/hgext/color.py --- a/hgext/color.py +++ b/hgext/color.py @@ -261,6 +261,15 @@ def _setupcmd(ui, cmd, table, func, effe ]) for status in effectsmap: - effects = ui.configlist('color', cmd + '.' + status) + configkey = cmd + '.' + status + effects = ui.configlist('color', configkey) if effects: - effectsmap[status] = effects + good = [] + for e in effects: + if e in _effect_params: + good.append(e) + else: + ui.warn(_("ignoring unknown color/effect %r " + "(configured in color.%s)\n") + % (e, configkey)) + effectsmap[status] = good diff --git a/tests/test-status-color b/tests/test-status-color --- a/tests/test-status-color +++ b/tests/test-status-color @@ -61,6 +61,9 @@ hg remove removed rm deleted hg copy modified copied +echo "% test unknown color" +hg --config color.status.modified=periwinkle status --color=always + # Run status with 2 different flags. # Check if result is the same or different. # If result is not as expected, raise error diff --git a/tests/test-status-color.out b/tests/test-status-color.out --- a/tests/test-status-color.out +++ b/tests/test-status-color.out @@ -124,3 +124,11 @@ adding .hgignore adding deleted adding modified adding removed +% test unknown color +ignoring unknown color/effect 'periwinkle' (configured in color.status.modified) +M modified +A added +A copied +R removed +! deleted +? unknown