diff -r 3c6893ba2d36 -r a1259e502bdf mercurial/hook.py --- a/mercurial/hook.py Thu Nov 10 02:21:15 2016 -0800 +++ b/mercurial/hook.py Thu Oct 20 22:39:59 2016 +0900 @@ -90,12 +90,6 @@ starttime = time.time() try: - # redirect IO descriptors to the ui descriptors so hooks - # that write directly to these don't mess up the command - # protocol when running through the command server - old = sys.stdout, sys.stderr, sys.stdin - sys.stdout, sys.stderr, sys.stdin = ui.fout, ui.ferr, ui.fin - r = obj(ui=ui, repo=repo, hooktype=name, **args) except Exception as exc: if isinstance(exc, error.Abort): @@ -111,7 +105,6 @@ ui.traceback() return True, True finally: - sys.stdout, sys.stderr, sys.stdin = old duration = time.time() - starttime ui.log('pythonhook', 'pythonhook-%s: %s finished in %0.2f seconds\n', name, funcname, duration)