changeset 14711:ac70f8d5987c stable

hook: write hook output to ui fout descriptor output on stderr will also be written to ui.fout, unless sys.__stdout__ is passed in (see util.system), thus not changing previous behavior. This fixes a bug where hooks run through the command server would mess up with the command protocol, sending non-channeled data to the client.
author Idan Kamara <idankk86@gmail.com>
date Tue, 21 Jun 2011 16:55:21 +0300
parents 6c7283faa967
children 8a62bae94425
files mercurial/hook.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hook.py	Tue Jun 21 15:21:57 2011 -0500
+++ b/mercurial/hook.py	Tue Jun 21 16:55:21 2011 +0300
@@ -107,7 +107,7 @@
     if 'HG_URL' in env and env['HG_URL'].startswith('remote:http'):
         r = util.system(cmd, environ=env, cwd=cwd, out=ui)
     else:
-        r = util.system(cmd, environ=env, cwd=cwd)
+        r = util.system(cmd, environ=env, cwd=cwd, out=ui.fout)
     if r:
         desc, r = util.explainexit(r)
         if throw: