Comments
Patch
@@ -297,20 +297,7 @@ def _modesetup(ui, coloropt):
return None
class colorui(uimod.ui):
-
- 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._bufferstates and self._bufferstates[-1][0]:
- return self.write(*args, **opts)
- if self._colormode == 'win32':
- for a in args:
- color.win32print(a, super(colorui, self).write_err, **opts)
- else:
- return super(colorui, self).write_err(
- *[self.label(a, label) for a in args], **opts)
+ pass
def uisetup(ui):
if ui.plain():
@@ -826,8 +826,18 @@ class ui(object):
with self.timeblockedsection('stdio'):
if not getattr(self.fout, 'closed', False):
self.fout.flush()
- for a in args:
- self.ferr.write(a)
+ if self._colormode == 'win32':
+ # windows color printing is its own can of crab, defer to
+ # the color module and that is it.
+ for a in args:
+ color.win32print(a, self.ferr.write, **opts)
+ else:
+ msgs = args
+ if self._colormode is not None:
+ label = opts.get('label', '')
+ msgs = [self.label(a, label) for a in args]
+ for a in msgs:
+ self.ferr.write(a)
# stderr may be buffered under win32 when redirected to files,
# including stdout.
if not getattr(self.ferr, 'closed', False):