commands: break import cycle
authorGregory Szorc <gregory.szorc@gmail.com>
Sat, 08 Aug 2015 14:30:39 -0700
changeset 25931 a0847285d207
parent 25930 221491bbaf7e
child 25932 d491f289045f
commands: break import cycle This was the easiest link in the chain to break as there was only one use of commandserver in commands.py. Other files had multiple users.
mercurial/commands.py
tests/test-module-imports.t
--- a/mercurial/commands.py	Sat Aug 08 00:47:19 2015 -0700
+++ b/mercurial/commands.py	Sat Aug 08 14:30:39 2015 -0700
@@ -13,7 +13,7 @@
 import hg, scmutil, util, revlog, copies, error, bookmarks
 import patch, help, encoding, templatekw, discovery
 import archival, changegroup, cmdutil, hbisect
-import sshserver, hgweb, commandserver
+import sshserver, hgweb
 import extensions
 from hgweb import server as hgweb_server
 import merge as mergemod
@@ -5713,6 +5713,7 @@
         s.serve_forever()
 
     if opts["cmdserver"]:
+        import commandserver
         service = commandserver.createservice(ui, repo, opts)
         return cmdutil.service(opts, initfn=service.init, runfn=service.run)
 
--- a/tests/test-module-imports.t	Sat Aug 08 00:47:19 2015 -0700
+++ b/tests/test-module-imports.t	Sat Aug 08 14:30:39 2015 -0700
@@ -128,5 +128,4 @@
      stdlib:    formatter
      relative:  config, error, progress, scmutil, util
   Import cycle: hgext.largefiles.basestore -> hgext.largefiles.localstore -> hgext.largefiles.basestore
-  Import cycle: mercurial.commands -> mercurial.commandserver -> mercurial.dispatch -> mercurial.commands
   [1]