Mercurial > public > mercurial-scm > hg-stable
comparison 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 |
comparison
equal
deleted
inserted
replaced
27351:28e50c4b15ed | 27352:9fd8f1552369 |
---|---|
14 import sys | 14 import sys |
15 import traceback | 15 import traceback |
16 | 16 |
17 from .i18n import _ | 17 from .i18n import _ |
18 from . import ( | 18 from . import ( |
19 dispatch, | |
20 encoding, | 19 encoding, |
21 error, | 20 error, |
22 util, | 21 util, |
23 ) | 22 ) |
24 | 23 |
184 return data | 183 return data |
185 | 184 |
186 def runcommand(self): | 185 def runcommand(self): |
187 """ reads a list of \0 terminated arguments, executes | 186 """ reads a list of \0 terminated arguments, executes |
188 and writes the return code to the result channel """ | 187 and writes the return code to the result channel """ |
188 from . import dispatch # avoid cycle | |
189 | 189 |
190 length = struct.unpack('>I', self._read(4))[0] | 190 length = struct.unpack('>I', self._read(4))[0] |
191 if not length: | 191 if not length: |
192 args = [] | 192 args = [] |
193 else: | 193 else: |