Traceback when running `bzr bundle .`
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Hello. This is reproducible for me on 0.16, 0.17rc1, and today's bzr.dev:
-------
% b init foo && cd foo && echo foo >foo && b add foo && b ci -m foo && b bundle .
added foo
added foo
Committed revision 1.
bzr: ERROR: bzrlib.
Traceback (most recent call last):
File "/home/
return run_bzr(argv)
File "/home/
ret = run(*run_argv)
File "/home/
return self.run(
File "/home/
base_
File "/home/
return inter.fetch(
File "/home/
self.
File "/home/
self.
File "/home/
lock_target()
File "/home/
return self.control_
File "/home/
raise errors.
ReadOnlyError: A write attempt was made in a read only transaction on LockableFiles(lock, file://
bzr 0.18.0dev0 on python 2.4.4.final.0 (linux2)
arguments: ['/home/
** please send this report to <email address hidden>
-------
Thanks.
affects /products/bzr
I can confirm that the steps reproduce it. I'm marking it Medium, though some may care more.
Basically because you supply a path ('.') it is trying to pull the latest revisions into the local repository, so that it can figure out what is new. However, at one point it realizes that the target is the source, so it re-uses the object. So when it goes to fetch between 2 objects it locks the source for 'read' and the target for 'write'. However, in this case, they are the same object, and the 'lock target write' is failing.
There are a few options:
a) Lock the target for write before we lock the source for read. You can always grab a read lock if you have a write lock, but you can't get a write lock with a read lock. This has the side effect that things will be locked, and then unlocked right away when it sees you already have the data.
b) Add a special case to the 'fetch()' code so that it sees they are the same object and knows it doesn't have to do anything before it tries to lock anything.
I think we don't do (a) right now because it makes sense to say "make sure I have the source ready before we start figuring out the target". But I don't think it really matters, we can do it the other way.
It is also possible that it is a layering problem. That high up we lock the source for read, and then much later on we lock the target for writing. Also, because of decorators, it may be difficult to untangle this. It might be easiest to define an "InterRepository" for the same object, which just defines everything as no-op. The "is_compatible()" check could just say:
return source is target