[PATCH 2 of 6 V3] hook: remove redundant code to redirect http hook output to client stream

Yuya Nishihara yuya at tcha.org
Wed Nov 12 08:38:01 CST 2014


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1415798511 -32400
#      Wed Nov 12 22:21:51 2014 +0900
# Node ID 161acee216ffa2782b08ea119090c21207dd2b8f
# Parent  d7ce6e56b0702b789ba9628a8d8a6a6400ff7194
hook: remove redundant code to redirect http hook output to client stream

out=ui and out=ui.fout should be the same here.  ui.fout was introduced at
afccc64eea73, which was not available when out=ui was added at c37f35d7f2f5.

diff --git a/mercurial/hook.py b/mercurial/hook.py
--- a/mercurial/hook.py
+++ b/mercurial/hook.py
@@ -131,10 +131,7 @@ def _exthook(ui, repo, name, cmd, args, 
         cwd = repo.root
     else:
         cwd = os.getcwd()
-    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, out=ui.fout)
+    r = util.system(cmd, environ=env, cwd=cwd, out=ui.fout)
 
     duration = time.time() - starttime
     ui.log('exthook', 'exthook-%s: %s finished in %0.2f seconds\n',


More information about the Mercurial-devel mailing list