Mercurial > hg
comparison hgext/color.py @ 8945:7b3d837ca60e
color: don't blow up if configured with unknown color (just warn).
author | Greg Ward <greg-hg@gerg.ca> |
---|---|
date | Thu, 25 Jun 2009 09:23:33 -0400 |
parents | 868670dbc237 |
children | a4ceae3aa7be |
comparison
equal
deleted
inserted
replaced
8944:dda4ad7c9ea9 | 8945:7b3d837ca60e |
---|---|
259 ('', 'color', 'auto', _("when to colorize (always, auto, or never)")), | 259 ('', 'color', 'auto', _("when to colorize (always, auto, or never)")), |
260 ('', 'no-color', None, _("don't colorize output")), | 260 ('', 'no-color', None, _("don't colorize output")), |
261 ]) | 261 ]) |
262 | 262 |
263 for status in effectsmap: | 263 for status in effectsmap: |
264 effects = ui.configlist('color', cmd + '.' + status) | 264 configkey = cmd + '.' + status |
265 effects = ui.configlist('color', configkey) | |
265 if effects: | 266 if effects: |
266 effectsmap[status] = effects | 267 good = [] |
268 for e in effects: | |
269 if e in _effect_params: | |
270 good.append(e) | |
271 else: | |
272 ui.warn(_("ignoring unknown color/effect %r " | |
273 "(configured in color.%s)\n") | |
274 % (e, configkey)) | |
275 effectsmap[status] = good |