# HG changeset patch # User Pierre-Yves David # Date 1487589128 -3600 # Node ID c42feb5f314362490400171f5cbe1dba6a641f71 # Parent abb92b3d370e116b29eba4d2e3154e9691c8edbb color: move '_colormode' to the core 'ui' class Having all 'ui' objects aware of 'color' allows us to update the core code to handle color. The mode will stay 'None' in the default case so that will not introduce any changes. diff -r abb92b3d370e -r c42feb5f3143 hgext/color.py --- a/hgext/color.py Tue Jan 17 17:25:48 2017 +0100 +++ b/hgext/color.py Mon Feb 20 12:12:08 2017 +0100 @@ -297,7 +297,6 @@ return None class colorui(uimod.ui): - _colormode = None def write(self, *args, **opts): if self._colormode is None: return super(colorui, self).write(*args, **opts) diff -r abb92b3d370e -r c42feb5f3143 mercurial/ui.py --- a/mercurial/ui.py Tue Jan 17 17:25:48 2017 +0100 +++ b/mercurial/ui.py Mon Feb 20 12:12:08 2017 +0100 @@ -127,6 +127,8 @@ raise error.SignalInterrupt class ui(object): + # color mode: see mercurial/color.py for possible value + _colormode = None def __init__(self, src=None): """Create a fresh new ui object if no src given