# HG changeset patch # User Siddharth Agarwal # Date 1366415840 25200 # Node ID b7b50a54bec9be298ac17bccda60e67b6d0d90a5 # Parent 64ea454e7d764df357290b1329445e23567cf86d color: turn colorui functions into forwards when color is None colorui will be set to None as necessary in an upcoming patch. diff -r 64ea454e7d76 -r b7b50a54bec9 hgext/color.py --- 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, '')