Flush stderr after write.
stderr can be buffered under win32 when redirected to a file,
including stdout.
--- a/mercurial/ui.py Thu Jan 11 23:13:32 2007 +0100
+++ b/mercurial/ui.py Wed Jan 10 20:35:27 2007 +0100
@@ -385,6 +385,9 @@
if not sys.stdout.closed: sys.stdout.flush()
for a in args:
sys.stderr.write(str(a))
+ # stderr may be buffered under win32 when redirected to files,
+ # including stdout.
+ if not sys.stderr.closed: sys.stderr.flush()
except IOError, inst:
if inst.errno != errno.EPIPE:
raise