# HG changeset patch
# User Pierre-Yves David <pierre-yves.da...@ens-lyon.org>
# Date 1487962421 -3600
#      Fri Feb 24 19:53:41 2017 +0100
# Node ID 620683bba165d6bbb9c6f163516102aaa264f980
# Parent  1a7930c207d7fd664f3d288974df36e3d8d32fd7
# EXP-Topic color
ui: extract low level part of 'write_err' in its own method

Same as for 'write' and '_write' we needs it available for some of the color 
logic.

diff -r 1a7930c207d7 -r 620683bba165 mercurial/ui.py
--- a/mercurial/ui.py   Fri Feb 24 19:28:45 2017 +0100
+++ b/mercurial/ui.py   Fri Feb 24 19:53:41 2017 +0100
@@ -824,11 +824,14 @@ class ui(object):
         self._progclear()
         if self._bufferstates and self._bufferstates[-1][0]:
             return self.write(*args, **opts)
+        self._write_err(*args, **opts)
+
+    def _write_err(self, *msgs, **opts):
         try:
             with self.timeblockedsection('stdio'):
                 if not getattr(self.fout, 'closed', False):
                     self.fout.flush()
-                for a in args:
+                for a in msgs:
                     self.ferr.write(a)
                 # stderr may be buffered under win32 when redirected to files,
                 # including stdout.
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to