diff tests/dumbhttp.py @ 30515:d9d8d78e6bc9

server: move cmdutil.service() to new module (API) And call it runservice() because I'll soon add createservice(). The main reason I'm going to introduce the 'server' module is to solve future dependency cycle between chgserver.py and commandserver.py. The 'server' module sits at the same layer as the cmdutil. I believe it's generally good to get rid of things from the big cmdutil module.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 15 Oct 2016 13:47:43 +0900
parents 075146e85bb6
children d05fefbb5ab3
line wrap: on
line diff
--- a/tests/dumbhttp.py	Wed Aug 17 20:41:05 2016 -0700
+++ b/tests/dumbhttp.py	Sat Oct 15 13:47:43 2016 +0900
@@ -11,7 +11,7 @@
 import sys
 
 from mercurial import (
-    cmdutil,
+    server,
     util,
 )
 
@@ -51,5 +51,5 @@
             'daemon': not options.foreground,
             'daemon_postexec': options.daemon_postexec}
     service = simplehttpservice(options.host, options.port)
-    cmdutil.service(opts, initfn=service.init, runfn=service.run,
-                    runargs=[sys.executable, __file__] + sys.argv[1:])
+    server.runservice(opts, initfn=service.init, runfn=service.run,
+                      runargs=[sys.executable, __file__] + sys.argv[1:])