log -v failure related to lazy imports

John Arbash Meinel john at arbash-meinel.com
Mon Oct 16 06:38:59 BST 2006

Hash: SHA1

Matthew D. Fuller wrote:
> With current bzr.dev, "log -v" in any tree falls apart with:
> bzr: ERROR: exceptions.ImportError: cannot import name RevisionTree
> If I back up to rev 2070, it works.  2071 ("use lazy importing to
> improve startup time") falls apart.

Thanks, I logged this as a real bug:

I have a branch for fixing the circular import, which probably avoids
this specific bug, but we need to discuss how to avoid this in the future.

One of the problems with lazy imports, is that there have been some code
paths which expect X to be imported because it was imported by Y, so
they do not explicitly import X. Now that we have lazy importing, this
is no longer always the case.

And our test suite doesn't help a whole lot, because it imports just
about everything before running any tests. We could spawn a real
subprocess for each 'run_bzr' test, but we are avoiding that, because it
makes the test suite much much slower.

We have been discussing how to do this in a systematic way, since this
sort of bug is similar to a race condition, which can be difficult to
test for.

Otherwise we might just fix them as they crop up, and deal with it from

Version: GnuPG v1.4.5 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


More information about the bazaar mailing list