Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hook.py @ 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 | 600e64004eb5 |
children | a59058fd074a |
comparison
equal
deleted
inserted
replaced
14709:6c7283faa967 | 14711:ac70f8d5987c |
---|---|
105 else: | 105 else: |
106 cwd = os.getcwd() | 106 cwd = os.getcwd() |
107 if 'HG_URL' in env and env['HG_URL'].startswith('remote:http'): | 107 if 'HG_URL' in env and env['HG_URL'].startswith('remote:http'): |
108 r = util.system(cmd, environ=env, cwd=cwd, out=ui) | 108 r = util.system(cmd, environ=env, cwd=cwd, out=ui) |
109 else: | 109 else: |
110 r = util.system(cmd, environ=env, cwd=cwd) | 110 r = util.system(cmd, environ=env, cwd=cwd, out=ui.fout) |
111 if r: | 111 if r: |
112 desc, r = util.explainexit(r) | 112 desc, r = util.explainexit(r) |
113 if throw: | 113 if throw: |
114 raise util.Abort(_('%s hook %s') % (name, desc)) | 114 raise util.Abort(_('%s hook %s') % (name, desc)) |
115 ui.warn(_('warning: %s hook %s\n') % (name, desc)) | 115 ui.warn(_('warning: %s hook %s\n') % (name, desc)) |