diff mercurial/commandserver.py @ 27352:9fd8f1552369

commandserver: cut import cycle by itself We generally make modules importable from the front-end layer, dispatch -> commands -> x. So the import cycle to dispatch should be resolved by the commandserver module.
author Yuya Nishihara <yuya@tcha.org>
date Tue, 24 Nov 2015 23:03:54 +0900
parents 28e50c4b15ed
children f4ca33e33781
line wrap: on
line diff
--- a/mercurial/commandserver.py	Tue Nov 24 22:58:40 2015 +0900
+++ b/mercurial/commandserver.py	Tue Nov 24 23:03:54 2015 +0900
@@ -16,7 +16,6 @@
 
 from .i18n import _
 from . import (
-    dispatch,
     encoding,
     error,
     util,
@@ -186,6 +185,7 @@
     def runcommand(self):
         """ reads a list of \0 terminated arguments, executes
         and writes the return code to the result channel """
+        from . import dispatch  # avoid cycle
 
         length = struct.unpack('>I', self._read(4))[0]
         if not length: