mercurial/ui.py
changeset 31094 0c003943134f
parent 31093 15d6488554b9
child 31106 a185b903bda3
--- a/mercurial/ui.py	Fri Feb 24 19:53:41 2017 +0100
+++ b/mercurial/ui.py	Mon Feb 20 12:42:23 2017 +0100
@@ -823,8 +823,17 @@
     def write_err(self, *args, **opts):
         self._progclear()
         if self._bufferstates and self._bufferstates[-1][0]:
-            return self.write(*args, **opts)
-        self._write_err(*args, **opts)
+            self.write(*args, **opts)
+        elif self._colormode == 'win32':
+            # windows color printing is its own can of crab, defer to
+            # the color module and that is it.
+            color.win32print(self._write_err, *args, **opts)
+        else:
+            msgs = args
+            if self._colormode is not None:
+                label = opts.get('label', '')
+                msgs = [self.label(a, label) for a in args]
+            self._write_err(*msgs, **opts)
 
     def _write_err(self, *msgs, **opts):
         try: