[MERGE][BUG #328135][1.12] Fix 'bzr init --development-wt5'
John Arbash Meinel
john at arbash-meinel.com
Thu Feb 12 16:18:13 GMT 2009
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
In summary, we have a circular import problem when trying to do "import
bzrlib.workingtree_4". I'll try to break it down:
1) If you do "import bzrlib.workingtree" it uses a lazy import to
"import bzrlib.workingtree_4.WorkingTreeFormat4" after building all of
the WT classes, and register WTF4 as the default tree format.
2) If you start with "import bzrlib.workingtree_4" the module gets
started and early on it calls "from bzrlib.workingtree import
WorkingTree3". Now when workingtree.py tries to import WTF4 late in the
game it fails because there is a partially complete wt_4 module which is
available, but is waiting for wt.py to finish importing.
This patch doesn't resolve the circular import logic (solvable by either
declaring WTF4 & 5 in workingtree.py, or by making the class
registration even lazier so it doesn't have to be imported during
'import' time at all).
Instead, it just does what the rest of the code does, and uses the
lazily imported attribute from 'bzrlib.workingtree'. I chose this as it
was the simple fix that got the job done.
I think it is semi-critical for 1.12, as otherwise none of the
- --development-wt5 formats are actually available. (The patch is against
the bzr.1.12 branch.)
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkmUS8UACgkQJdeBCYSNAAOTeQCgt4rxjsj1/8P90+egyqAESdLe
Dv0AoMTIjwyOw0llA1uUnQIEhA7lN3+u
=wNY2
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: bug328135.patch
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20090212/00a60e8e/attachment-0001.diff
More information about the bazaar
mailing list