##// END OF EJS Templates
hook: do not redirect stdout/err/in to ui while running in-process hooks (BC)...
Yuya Nishihara -
r30363:a1259e50 default
parent child Browse files
Show More
@@ -90,12 +90,6 def _pythonhook(ui, repo, name, hname, f
90 90 starttime = time.time()
91 91
92 92 try:
93 # redirect IO descriptors to the ui descriptors so hooks
94 # that write directly to these don't mess up the command
95 # protocol when running through the command server
96 old = sys.stdout, sys.stderr, sys.stdin
97 sys.stdout, sys.stderr, sys.stdin = ui.fout, ui.ferr, ui.fin
98
99 93 r = obj(ui=ui, repo=repo, hooktype=name, **args)
100 94 except Exception as exc:
101 95 if isinstance(exc, error.Abort):
@@ -111,7 +105,6 def _pythonhook(ui, repo, name, hname, f
111 105 ui.traceback()
112 106 return True, True
113 107 finally:
114 sys.stdout, sys.stderr, sys.stdin = old
115 108 duration = time.time() - starttime
116 109 ui.log('pythonhook', 'pythonhook-%s: %s finished in %0.2f seconds\n',
117 110 name, funcname, duration)
@@ -236,8 +236,6 check that local configs for the cached
236 236 ... 'id'],
237 237 ... input=stringio('some input'))
238 238 *** runcommand --config hooks.pre-identify=python:hook.hook id
239 hook talking
240 now try to read something: 'some input'
241 239 eff892de26ec tip
242 240
243 241 $ rm hook.py*
General Comments 0
You need to be logged in to leave comments. Login now