##// END OF EJS Templates
cmdserver: wrap 'pipe' mode server by service object...
Yuya Nishihara -
r22988:32b77aba default
parent child Browse files
Show More
@@ -5536,8 +5536,8 b' def serve(ui, repo, **opts):'
5536 s.serve_forever()
5536 s.serve_forever()
5537
5537
5538 if opts["cmdserver"]:
5538 if opts["cmdserver"]:
5539 s = commandserver.server(ui, repo, opts["cmdserver"])
5539 service = commandserver.pipeservice(ui, repo, opts)
5540 return s.serve()
5540 return cmdutil.service(opts, initfn=service.init, runfn=service.run)
5541
5541
5542 # this way we can check if something was given in the command-line
5542 # this way we can check if something was given in the command-line
5543 if opts.get('port'):
5543 if opts.get('port'):
@@ -248,3 +248,13 b' class server(object):'
248 return 1
248 return 1
249
249
250 return 0
250 return 0
251
252 class pipeservice(object):
253 def __init__(self, ui, repo, opts):
254 self.server = server(ui, repo, opts['cmdserver'])
255
256 def init(self):
257 pass
258
259 def run(self):
260 return self.server.serve()
General Comments 0
You need to be logged in to leave comments. Login now