Mercurial > hg-stable
diff hgext/color.py @ 30175:8915c68f3eba
color: debugcolor should emit the user-defined colors
This also fixes a long-standing bug that reversed the sense of the color
name and the label used to print it, which was never relevant before.
author | Danek Duvall <danek.duvall@oracle.com> |
---|---|
date | Thu, 13 Oct 2016 13:10:01 -0700 |
parents | 5d777fe4615d |
children | 9f41b66cffc0 |
line wrap: on
line diff
--- a/hgext/color.py Thu Oct 13 12:01:41 2016 -0700 +++ b/hgext/color.py Thu Oct 13 13:10:01 2016 -0700 @@ -533,10 +533,16 @@ _styles = {} for effect in _effects.keys(): _styles[effect] = effect + if _terminfo_params: + for k, v in ui.configitems('color'): + if k.startswith('color.'): + _styles[k] = k[6:] + elif k.startswith('terminfo.'): + _styles[k] = k[9:] ui.write(('color mode: %s\n') % ui._colormode) ui.write(_('available colors:\n')) - for label, colors in _styles.items(): - ui.write(('%s\n') % colors, label=label) + for colorname, label in _styles.items(): + ui.write(('%s\n') % colorname, label=label) if os.name != 'nt': w32effects = None