[PATCH] dispatch: split global error handling out so it can be reused

Jun Wu quark at fb.com
Wed Aug 10 10:04:06 EDT 2016


Excerpts from Yuya Nishihara's message of 2016-08-10 22:55:26 +0900:
> On Wed, 10 Aug 2016 14:42:52 +0100, Jun Wu wrote:
> > Excerpts from Yuya Nishihara's message of 2016-08-10 21:01:25 +0900:
> > > The code and docstring look good, but did you try using this function?
> > > I suspect it would create an import cycle.
> > 
> > I tried it using debugshell before sending and it looked okay. I didn't see
> > cycles?
> 
> Suppose the next patch will import dispatch.py from worker.py,
> test-check-module-imports.t will report the following error:
> 
> +  Import cycle: mercurial.dispatch -> mercurial.hg -> mercurial.merge -> mercurial.worker -> mercurial.dispatch
> +  Import cycle: mercurial.commands -> mercurial.merge -> mercurial.worker -> mercurial.dispatch -> mercurial.commands
> +  Import cycle: mercurial.bundlerepo -> mercurial.localrepo -> mercurial.merge -> mercurial.worker -> mercurial.dispatch -> mercurial.hg -> mercurial.bundlerepo

It could be solved by importing in the method instead of globally.
commandserver.py already has: "from . import dispatch  # avoid cycle"


More information about the Mercurial-devel mailing list