changeset 31093:15d6488554b9

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.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Fri, 24 Feb 2017 19:53:41 +0100
parents cb759f7f940d
children 0c003943134f
files mercurial/ui.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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 @@
         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.