serve: unify cmdutil.service() calls of commandserver and hgweb
authorYuya Nishihara <yuya@tcha.org>
Sat, 31 Oct 2015 22:17:05 +0900
changeset 27140 dfdac09b57dd
parent 27139 d73f23344dc7
child 27141 a4e3dec3010e
serve: unify cmdutil.service() calls of commandserver and hgweb
mercurial/commands.py
--- a/mercurial/commands.py	Sat Oct 31 22:15:16 2015 +0900
+++ b/mercurial/commands.py	Sat Oct 31 22:17:05 2015 +0900
@@ -5972,10 +5972,9 @@
     if opts["cmdserver"]:
         import commandserver
         service = commandserver.createservice(ui, repo, opts)
-        return cmdutil.service(opts, initfn=service.init, runfn=service.run)
-
-    service = hgweb.createservice(ui, repo, opts)
-    cmdutil.service(opts, initfn=service.init, runfn=service.run)
+    else:
+        service = hgweb.createservice(ui, repo, opts)
+    return cmdutil.service(opts, initfn=service.init, runfn=service.run)
 
 @command('^status|st',
     [('A', 'all', None, _('show status of all files')),