mercurial/server.py
changeset 30507 dd539e2d89aa
parent 30506 d9d8d78e6bc9
child 30509 add7bcad1d9c
--- a/mercurial/server.py	Sat Oct 15 13:47:43 2016 +0900
+++ b/mercurial/server.py	Sat Oct 15 13:57:17 2016 +0900
@@ -15,6 +15,7 @@
 from .i18n import _
 
 from . import (
+    commandserver,
     error,
     util,
 )
@@ -105,3 +106,15 @@
 
     if runfn:
         return runfn()
+
+_cmdservicemap = {
+    'pipe': commandserver.pipeservice,
+    'unix': commandserver.unixforkingservice,
+}
+
+def createcmdservice(ui, repo, opts):
+    mode = opts['cmdserver']
+    try:
+        return _cmdservicemap[mode](ui, repo, opts)
+    except KeyError:
+        raise error.Abort(_('unknown mode %s') % mode)