[PATCH 3 of 3] serve: unify cmdutil.service() calls of commandserver and hgweb

Yuya Nishihara yuya at tcha.org
Tue Nov 24 07:53:08 CST 2015


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1446297425 -32400
#      Sat Oct 31 22:17:05 2015 +0900
# Node ID 3cda2a60ab931e628db00ea1995f3ef98db80ac0
# Parent  5b13304492f867291e0c8e09f6117e9e69b7d6af
serve: unify cmdutil.service() calls of commandserver and hgweb

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -5940,10 +5940,9 @@ def serve(ui, repo, **opts):
     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')),


More information about the Mercurial-devel mailing list