changeset 27140:dfdac09b57dd

serve: unify cmdutil.service() calls of commandserver and hgweb
author Yuya Nishihara <yuya@tcha.org>
date Sat, 31 Oct 2015 22:17:05 +0900
parents d73f23344dc7
children a4e3dec3010e
files mercurial/commands.py
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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')),