diff mercurial/commandserver.py @ 23322:000cfc8b3913

cmdserver: use given streams as pipe channels like other commands Because commandserver itself is an hg subcommand, it shouldn't use stdio directly in principle.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 15 Nov 2014 12:43:35 +0900
parents 19f5273c9f3e
children bc374458688b
line wrap: on
line diff
--- a/mercurial/commandserver.py	Fri Nov 14 16:38:58 2014 -0800
+++ b/mercurial/commandserver.py	Sat Nov 15 12:43:35 2014 +0900
@@ -7,7 +7,7 @@
 
 from i18n import _
 import struct
-import sys, os, errno, traceback, SocketServer
+import os, errno, traceback, SocketServer
 import dispatch, encoding, util
 
 logfile = None
@@ -250,7 +250,7 @@
 
 class pipeservice(object):
     def __init__(self, ui, repo, opts):
-        self.server = server(ui, repo, sys.stdin, sys.stdout)
+        self.server = server(ui, repo, ui.fin, ui.fout)
 
     def init(self):
         pass