[MERGE][#144421][#144300] Use write lock in log and status with '-r branch:URL'

Lukáš Lalinský lalinsky at gmail.com
Tue Mar 25 20:14:29 GMT 2008


On Ut, 2008-03-25 at 21:46 +0200, Alexander Belchenko wrote:
> Lukáš Lalinský пишет:
> > This patch replaces lock_read with lock_write in log and status if the
> > 'branch:' revision specifier is used. I realize it would be probably
> > better to just get rid of the implicit fetching, but I think fixing the
> > lock is good enough as an interim solution.
> 
> Today I discover that bzr diff -rbranch:XXX works, but bzr status -rbranch:XXX
> is not. I found workaround to use `bzr diff -rbranch:XXX | grep '^==='` instead
> of status.
> 
> Why status does not work? What makes status so special that it can't work? Why diff can?
> Could anybody shed some light on this? Looking at this patch I don't understand
> why for write lock needed.

"bzr diff" works because it doesn't have a global lock_read around it
(which makes is slower and there were at least two patches for it, but
they break the test suite because of this bug), which means it can do
lock_write anytime it can. But in "bzr status" the code is called when
the repository is already locked, and it can't upgrade a read lock to a
write lock.

The reason why it fails at all is that "branch:" loads data from the
branch to the local repository and then loads the head revision, but to
put anything to the repository it needs a write lock.

Lukas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Toto je =?ISO-8859-1?Q?digit=E1lne?=
	=?ISO-8859-1?Q?_podp=EDsan=E1?= =?UTF-8?Q?_=C4=8Das=C5=A5?=
	=?ISO-8859-1?Q?_spr=E1vy?=
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080325/f3676c67/attachment-0001.pgp 


More information about the bazaar mailing list