##// END OF EJS Templates
sshserver: redirect stdin/stdout early and use duplicated streams...
Yuya Nishihara -
r37964:bfe8ef6e default
parent child Browse files
Show More
@@ -18,7 +18,6 b' from .thirdparty import ('
18 from . import (
18 from . import (
19 encoding,
19 encoding,
20 error,
20 error,
21 hook,
22 pycompat,
21 pycompat,
23 util,
22 util,
24 wireprototypes,
23 wireprototypes,
@@ -785,8 +784,7 b' class sshserver(object):'
785 def __init__(self, ui, repo, logfh=None):
784 def __init__(self, ui, repo, logfh=None):
786 self._ui = ui
785 self._ui = ui
787 self._repo = repo
786 self._repo = repo
788 self._fin = ui.fin
787 self._fin, self._fout = procutil.protectstdio(ui.fin, ui.fout)
789 self._fout = ui.fout
790
788
791 # Log write I/O to stdout and stderr if configured.
789 # Log write I/O to stdout and stderr if configured.
792 if logfh:
790 if logfh:
@@ -795,11 +793,10 b' class sshserver(object):'
795 ui.ferr = util.makeloggingfileobject(
793 ui.ferr = util.makeloggingfileobject(
796 logfh, ui.ferr, 'e', logdata=True)
794 logfh, ui.ferr, 'e', logdata=True)
797
795
798 hook.redirect(True)
799 ui.fout = repo.ui.fout = ui.ferr
800
801 def serve_forever(self):
796 def serve_forever(self):
802 self.serveuntil(threading.Event())
797 self.serveuntil(threading.Event())
798 procutil.restorestdio(self._ui.fin, self._ui.fout,
799 self._fin, self._fout)
803 sys.exit(0)
800 sys.exit(0)
804
801
805 def serveuntil(self, ev):
802 def serveuntil(self, ev):
General Comments 0
You need to be logged in to leave comments. Login now