ui: extract buffer write from protect and timed 'write_err' output
That subcall to 'self.write' is never doing actual write but only store things
in buffers. So we do not need to protect it for exception not to time its
execution.
This will make it easier to extract a '_write_err' function as we did for
'write'.
--- a/mercurial/ui.py Mon Feb 20 12:31:39 2017 +0100
+++ b/mercurial/ui.py Fri Feb 24 19:28:45 2017 +0100
@@ -822,9 +822,9 @@
def write_err(self, *args, **opts):
self._progclear()
+ if self._bufferstates and self._bufferstates[-1][0]:
+ return self.write(*args, **opts)
try:
- if self._bufferstates and self._bufferstates[-1][0]:
- return self.write(*args, **opts)
with self.timeblockedsection('stdio'):
if not getattr(self.fout, 'closed', False):
self.fout.flush()