--- 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)