diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py --- a/mercurial/debugcommands.py +++ b/mercurial/debugcommands.py @@ -462,6 +462,8 @@ def _debugdisplaycolor(ui): def _debugdisplaystyle(ui): ui.write(_('available style:\n')) + if not ui._styles: + return width = max(len(s) for s in ui._styles) for label, effects in sorted(ui._styles.items()): ui.write('%s' % label, label=label) diff --git a/tests/test-debugcommands.t b/tests/test-debugcommands.t --- a/tests/test-debugcommands.t +++ b/tests/test-debugcommands.t @@ -333,6 +333,19 @@ Test cache warming command .hg/cache/rbc-names-v1 .hg/cache/branch2-served +Test debugcolor + +#if no-windows + $ hg debugcolor --style --color always | egrep 'mode|style|log\.' + color mode: ansi + available style: + \x1b[0;33mlog.changeset\x1b[0m: \x1b[0;33myellow\x1b[0m (esc) +#endif + + $ hg debugcolor --style --color never + color mode: None + available style: + $ cd .. Test internal debugstacktrace command