comparison mercurial/chgserver.py @ 41285:cf8677cd7286

ui: proxy protect/restorestdio() calls to update internal flag It should be better to manage the redirection flag solely by the ui class.
author Yuya Nishihara <yuya@tcha.org>
date Wed, 26 Sep 2018 21:41:52 +0900
parents e7110f44ee2d
children 78027e7bc544
comparison
equal deleted inserted replaced
41284:b0e3f2d7c143 41285:cf8677cd7286
198 self._csystem = csystem 198 self._csystem = csystem
199 199
200 def _runsystem(self, cmd, environ, cwd, out): 200 def _runsystem(self, cmd, environ, cwd, out):
201 # fallback to the original system method if 201 # fallback to the original system method if
202 # a. the output stream is not stdout (e.g. stderr, cStringIO), 202 # a. the output stream is not stdout (e.g. stderr, cStringIO),
203 # b. or stdout is redirected by protectstdio(), 203 # b. or stdout is redirected by protectfinout(),
204 # because the chg client is not aware of these situations and 204 # because the chg client is not aware of these situations and
205 # will behave differently (i.e. write to stdout). 205 # will behave differently (i.e. write to stdout).
206 if (out is not self.fout 206 if (out is not self.fout
207 or not util.safehasattr(self.fout, 'fileno') 207 or not util.safehasattr(self.fout, 'fileno')
208 or self.fout.fileno() != procutil.stdout.fileno() 208 or self.fout.fileno() != procutil.stdout.fileno()