[BUG] Pull command on Windows: we have 2 problems

Aaron Bentley aaron.bentley at utoronto.ca
Wed Oct 26 21:32:18 BST 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

John A Meinel wrote:
> I think the basic problem is that there are 2 branches that are being
> grabbed. The merge code is creating its own Branch object, rather than
> re-using the one used by "pull".

Okay, so these are the sort of locking composition problems that
originally led me to suggest a system of lock singletons back when we
were first discussing it.

> Here are possible fixes:
> 
> 1) Change the merge interface to take a Branch object, instead of just a
> path
> 2) Make sure the pull code has destroyed its Branch object before
> calling merge (this is difficult, because I believe it wants to use it
> afterwards, though it could always just grab it again).

I see those as workarounds.  I'd add
3) change Branch so that read-locked operations will work when Branch is
write-locked.

> I think the basic difference is that on Linux, if you already have a
> write lock on a file, it silently ignores the request for a read lock.

We can emulate that by factoring out the lock into a LocationLock
object, and keeping a global dict of LocationLocks.  I think factoring
out LocationLock would be a positive step, no matter what.

> Probably Aaron should do the changes so that the merge is done using an
> actual Branch object, rather than a path.
> I know "merge.merge()" is designed for easy command line interpretation,
> and there is a different function for internal bzr code. 

Actually, pull's already using that internal function.  The problem is
in there.

But the attached patch will probably fix it.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDX+fS0F+nu1YWqI0RAphWAJ9KXPgpJhYkLxP2adq1uHeLB2TrawCfR2FG
xgqPzhguJHOUeK+C3EL7SQI=
=0c/o
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: w32merge.patch
Type: text/x-patch
Size: 467 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051026/f7c2ce1d/attachment.bin 


More information about the bazaar mailing list