##// END OF EJS Templates
color: restore _style global after debugcolor ran...
Pierre-Yves David -
r30283:e1f6898a default
parent child Browse files
Show More
@@ -540,19 +540,23 b' def extsetup(ui):'
540 def debugcolor(ui, repo, **opts):
540 def debugcolor(ui, repo, **opts):
541 """show available colors and effects"""
541 """show available colors and effects"""
542 global _styles
542 global _styles
543 _styles = {}
543 oldstyle = _styles
544 for effect in _effects.keys():
544 try:
545 _styles[effect] = effect
545 _styles = {}
546 if _terminfo_params:
546 for effect in _effects.keys():
547 for k, v in ui.configitems('color'):
547 _styles[effect] = effect
548 if k.startswith('color.'):
548 if _terminfo_params:
549 _styles[k] = k[6:]
549 for k, v in ui.configitems('color'):
550 elif k.startswith('terminfo.'):
550 if k.startswith('color.'):
551 _styles[k] = k[9:]
551 _styles[k] = k[6:]
552 ui.write(('color mode: %s\n') % ui._colormode)
552 elif k.startswith('terminfo.'):
553 ui.write(_('available colors:\n'))
553 _styles[k] = k[9:]
554 for colorname, label in _styles.items():
554 ui.write(('color mode: %s\n') % ui._colormode)
555 ui.write(('%s\n') % colorname, label=label)
555 ui.write(_('available colors:\n'))
556 for colorname, label in _styles.items():
557 ui.write(('%s\n') % colorname, label=label)
558 finally:
559 _styles = oldstyle
556
560
557 if os.name != 'nt':
561 if os.name != 'nt':
558 w32effects = None
562 w32effects = None
General Comments 0
You need to be logged in to leave comments. Login now