# HG changeset patch # User Idan Kamara # Date 2011-06-21 13:55:21 # Node ID ac70f8d5987c7146aa6f968ae9bb665ab1cbc882 # Parent 6c7283faa967741009f8223b04b1098ada8ec552 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. diff --git a/mercurial/hook.py b/mercurial/hook.py --- a/mercurial/hook.py +++ b/mercurial/hook.py @@ -107,7 +107,7 @@ def _exthook(ui, repo, name, cmd, args, 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: