comparison 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
comparison
equal deleted inserted replaced
30174:5d777fe4615d 30175:8915c68f3eba
531 def debugcolor(ui, repo, **opts): 531 def debugcolor(ui, repo, **opts):
532 global _styles 532 global _styles
533 _styles = {} 533 _styles = {}
534 for effect in _effects.keys(): 534 for effect in _effects.keys():
535 _styles[effect] = effect 535 _styles[effect] = effect
536 if _terminfo_params:
537 for k, v in ui.configitems('color'):
538 if k.startswith('color.'):
539 _styles[k] = k[6:]
540 elif k.startswith('terminfo.'):
541 _styles[k] = k[9:]
536 ui.write(('color mode: %s\n') % ui._colormode) 542 ui.write(('color mode: %s\n') % ui._colormode)
537 ui.write(_('available colors:\n')) 543 ui.write(_('available colors:\n'))
538 for label, colors in _styles.items(): 544 for colorname, label in _styles.items():
539 ui.write(('%s\n') % colors, label=label) 545 ui.write(('%s\n') % colorname, label=label)
540 546
541 if os.name != 'nt': 547 if os.name != 'nt':
542 w32effects = None 548 w32effects = None
543 else: 549 else:
544 import ctypes 550 import ctypes