comparison mercurial/wireprotoserver.py @ 39809:23a00bc90a3c stable

chgserver: do not send system() back to client if stdio redirected (issue5992) As the chg client doesn't know server-side stdio redirection, the server shouldn't upcall on "runsystem" request if the stdio streams are redirected. This patch teaches ui to remember the redirection flag, which is updated by the caller right now. Future patches (for default) will add ui methods to manage this flag internally.
author Yuya Nishihara <yuya@tcha.org>
date Wed, 26 Sep 2018 21:24:14 +0900
parents bfe8ef6e370e
children a9f56e4501c1
comparison
equal deleted inserted replaced
39808:1b9be0b26511 39809:23a00bc90a3c
783 class sshserver(object): 783 class sshserver(object):
784 def __init__(self, ui, repo, logfh=None): 784 def __init__(self, ui, repo, logfh=None):
785 self._ui = ui 785 self._ui = ui
786 self._repo = repo 786 self._repo = repo
787 self._fin, self._fout = procutil.protectstdio(ui.fin, ui.fout) 787 self._fin, self._fout = procutil.protectstdio(ui.fin, ui.fout)
788 # TODO: manage the redirection flag internally by ui
789 ui._finoutredirected = (self._fin, self._fout) != (ui.fin, ui.fout)
788 790
789 # Log write I/O to stdout and stderr if configured. 791 # Log write I/O to stdout and stderr if configured.
790 if logfh: 792 if logfh:
791 self._fout = util.makeloggingfileobject( 793 self._fout = util.makeloggingfileobject(
792 logfh, self._fout, 'o', logdata=True) 794 logfh, self._fout, 'o', logdata=True)