# HG changeset patch # User Siddharth Agarwal # Date 2013-04-19 23:57:20 # 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 --git a/hgext/color.py b/hgext/color.py --- a/hgext/color.py +++ b/hgext/color.py @@ -317,6 +317,9 @@ def configstyles(ui): 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 @@ class colorui(uimod.ui): _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 @@ class colorui(uimod.ui): *[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 @@ class colorui(uimod.ui): *[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, '')