Mercurial > public > mercurial-scm > hg-stable
comparison 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 |
comparison
equal
deleted
inserted
replaced
23321:d716b1cec5cf | 23322:000cfc8b3913 |
---|---|
5 # This software may be used and distributed according to the terms of the | 5 # This software may be used and distributed according to the terms of the |
6 # GNU General Public License version 2 or any later version. | 6 # GNU General Public License version 2 or any later version. |
7 | 7 |
8 from i18n import _ | 8 from i18n import _ |
9 import struct | 9 import struct |
10 import sys, os, errno, traceback, SocketServer | 10 import os, errno, traceback, SocketServer |
11 import dispatch, encoding, util | 11 import dispatch, encoding, util |
12 | 12 |
13 logfile = None | 13 logfile = None |
14 | 14 |
15 def log(*args): | 15 def log(*args): |
248 | 248 |
249 return 0 | 249 return 0 |
250 | 250 |
251 class pipeservice(object): | 251 class pipeservice(object): |
252 def __init__(self, ui, repo, opts): | 252 def __init__(self, ui, repo, opts): |
253 self.server = server(ui, repo, sys.stdin, sys.stdout) | 253 self.server = server(ui, repo, ui.fin, ui.fout) |
254 | 254 |
255 def init(self): | 255 def init(self): |
256 pass | 256 pass |
257 | 257 |
258 def run(self): | 258 def run(self): |