Skip to content
Snippets Groups Projects
Commit 7556507f authored by Pierre-Yves David's avatar Pierre-Yves David
Browse files

color: extract color and effect display from 'debugcolor'

We are about to introduce a second mode for 'hg debugcolor' that would list the
known label and their configuration, so we split the code related to color and
effect out of the main function.
parent e1f6898a
No related branches found
No related tags found
No related merge requests found
......@@ -539,6 +539,10 @@
@command('debugcolor', [], 'hg debugcolor')
def debugcolor(ui, repo, **opts):
"""show available colors and effects"""
ui.write(('color mode: %s\n') % ui._colormode)
return _debugdisplaycolor(ui)
def _debugdisplaycolor(ui):
global _styles
oldstyle = _styles
try:
......@@ -551,7 +555,6 @@
_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 colorname, label in _styles.items():
ui.write(('%s\n') % colorname, label=label)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment