Mercurial > hg
changeset 19072:b7b50a54bec9 stable
color: turn colorui functions into forwards when color is None
colorui will be set to None as necessary in an upcoming patch.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Fri, 19 Apr 2013 16:57:20 -0700 |
parents | 64ea454e7d76 |
children | d78d0256198e |
files | hgext/color.py |
diffstat | 1 files changed, 12 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/color.py Fri Apr 19 18:26:35 2013 -0300 +++ b/hgext/color.py Fri Apr 19 16:57:20 2013 -0700 @@ -317,6 +317,9 @@ class colorui(uimod.ui): def popbuffer(self, labeled=False): + if self._colormode is None: + return super(colorui, self).popbuffer(labeled) + if labeled: return ''.join(self.label(a, label) for a, label in self._buffers.pop()) @@ -324,6 +327,9 @@ _colormode = 'ansi' def write(self, *args, **opts): + if self._colormode is None: + return super(colorui, self).write(*args, **opts) + label = opts.get('label', '') if self._buffers: self._buffers[-1].extend([(str(a), label) for a in args]) @@ -335,6 +341,9 @@ *[self.label(str(a), label) for a in args], **opts) def write_err(self, *args, **opts): + if self._colormode is None: + return super(colorui, self).write_err(*args, **opts) + label = opts.get('label', '') if self._colormode == 'win32': for a in args: @@ -344,6 +353,9 @@ *[self.label(str(a), label) for a in args], **opts) def label(self, msg, label): + if self._colormode is None: + return super(colorui, self).label(msg, label) + effects = [] for l in label.split(): s = _styles.get(l, '')