[BUG][0.12] 'bzr init' creates branches incompatibile with bzr-0.11
John Arbash Meinel
john at arbash-meinel.com
Tue Oct 17 08:41:34 BST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
It seems that bzr-0.11 is not compatible with trees that have unique
tree roots. And Aaron's latest changes alter the behavior of 'bzr init'
so that newly created trees have a unique root id.
Specifically, the code is in bzrlib/transform.py. I think Aaron fixed a
bug by setting the working tree's root id when necessary with these
lines (in build_tree() around line 967):
if tree.inventory.root is not None:
wt.set_root_id(tree.inventory.root.file_id)
I'm very happy to see bzr-0.12 be able to support trees with unique
roots, but I don't want us creating trees which are incompatible with
releases which claim compatibility.
To test this, have a copy of bzr.dev (<2078 or bzr-0.11) and the latest
version of bzr.dev (>2078). If you do:
../bzr.dev/bzr init foo
../bzr-0.11/bzr checkout foo bar
You will get a traceback similar to this:
Traceback (most recent call last):
File "/home/jameinel/bin/bzr11", line 85, in ?
exit_val = bzrlib.commands.main(sys.argv)
File "/home/jameinel/dev/bzr/releases/bzr-0.11/bzrlib/commands.py",
line 604, in main
ret = run_bzr_catch_errors(argv)
File "/home/jameinel/dev/bzr/releases/bzr-0.11/bzrlib/commands.py",
line 611, in run_bzr_catch_errors
return run_bzr(argv)
File "/home/jameinel/dev/bzr/releases/bzr-0.11/bzrlib/commands.py",
line 573, in run_bzr
ret = run(*run_argv)
File "/home/jameinel/dev/bzr/releases/bzr-0.11/bzrlib/commands.py",
line 282, in run_argv_aliases
return self.run(**all_cmd_args)
File "/home/jameinel/dev/bzr/releases/bzr-0.11/bzrlib/builtins.py",
line 812, in run
source.create_checkout(to_location, revision_id, lightweight)
File "/home/jameinel/dev/bzr/releases/bzr-0.11/bzrlib/branch.py", line
623, in create_checkout
return checkout.create_workingtree(revision_id)
File "/home/jameinel/dev/bzr/releases/bzr-0.11/bzrlib/bzrdir.py", line
879, in create_workingtree
return WorkingTreeFormat.get_default_format().initialize(self,
revision_id)
File "/home/jameinel/dev/bzr/releases/bzr-0.11/bzrlib/workingtree.py",
line 2037, in initialize
build_tree(basis_tree, wt)
File "/home/jameinel/dev/bzr/releases/bzr-0.11/bzrlib/transform.py",
line 996, in build_tree
raise repr(entry.parent_id)
'tree_root-20061016105450-mcxlw41bk500m1n8-1'
Because of this bug in bzr-0.11, it seems we need to only create trees
with unique roots after we bump the disk formats for working tree and
repository. We already have RepositoryKnit2 almost ready to go, we just
need to update WorkingTree as well (WorkingTree4, in essence, just
changes the .bzr/checkout/inventory to be a format=6 inventory).
I think it is a little late to do this sort of format bump for bzr-0.12,
so I'm proposing this simple fix:
=== modified file 'bzrlib/workingtree.py'
- --- bzrlib/workingtree.py 2006-10-16 01:13:59 +0000
+++ bzrlib/workingtree.py 2006-10-17 07:35:17 +0000
@@ -2100,7 +2100,7 @@
branch = a_bzrdir.open_branch()
if revision_id is None:
revision_id = branch.last_revision()
- - inv = Inventory(root_id=gen_root_id())
+ inv = Inventory()
wt = WorkingTree3(a_bzrdir.root_transport.local_abspath('.'),
branch,
inv,
This should keep bzr-0.12 from creating new branches that bzr-0.11
cannot handle.
I'm open to suggestions, and it would be nice if we could add tests that
bzr-0.XX is actually compatible with bzr-0.(XX-1). But for now, I just
want to get that patch merged to prevent people from accidentally
creating incompatible branches. (The whole watershed issue).
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFFNIkuJdeBCYSNAAMRAkVeAKDSFJESEu9U0FfSF3RoaYBQm9VjYQCeL/vx
IgHoqDn7lAW1KRuaWInzOYg=
=8Q4A
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list