changeset 25931:a0847285d207

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.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 08 Aug 2015 14:30:39 -0700
parents 221491bbaf7e
children d491f289045f
files mercurial/commands.py tests/test-module-imports.t
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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]