--- a/mercurial/hook.py Fri Apr 10 22:37:40 2015 -0400
+++ b/mercurial/hook.py Fri Apr 10 22:30:19 2015 -0400
@@ -200,6 +200,11 @@
r = _pythonhook(ui, repo, name, hname, hookfn, args, throw) or r
else:
r = _exthook(ui, repo, hname, cmd, args, throw) or r
+
+ # The stderr is fully buffered on Windows when connected to a pipe.
+ # A forcible flush is required to make small stderr data in the
+ # remote side available to the client immediately.
+ sys.stderr.flush()
finally:
if _redirect and oldstdout >= 0:
os.dup2(oldstdout, stdoutno)