diff -r ae37e395a110 -r 27e48410380d hgext/color.py --- a/hgext/color.py Fri Nov 18 18:27:13 2016 +0100 +++ b/hgext/color.py Fri Nov 18 18:29:19 2016 +0100 @@ -546,10 +546,9 @@ return _debugdisplaycolor(ui) def _debugdisplaycolor(ui): - global _styles - oldstyle = _styles + oldstyle = _styles.copy() try: - _styles = {} + _styles.clear() for effect in _effects.keys(): _styles[effect] = effect if _terminfo_params: @@ -565,7 +564,8 @@ for colorname, label in items: ui.write(('%s\n') % colorname, label=label) finally: - _styles = oldstyle + _styles.clear() + _styles.update(oldstyle) def _debugdisplaystyle(ui): ui.write(_('available style:\n'))