[MERGE] really get push working with less lock churn
Robert Collins
robert.collins at canonical.com
Wed Apr 15 08:22:52 BST 2009
On Wed, 2009-04-15 at 17:05 +1000, Andrew Bennetts wrote:
> Robert Collins wrote:
> > === modified file 'bzrlib/branch.py'
> [...]
> > + # XXX: Lock correctness - should unlock our old repo if we were
> > + # locked.
>
> Is this XXX likely to be a problem in the near future?
No, its an existing bug I saw when reading the code.
> > def lock_read(self):
> > - self.repository.lock_read()
> > + repo_control = getattr(self.repository, 'control_files', None)
> > + if self.control_files == repo_control or not self.is_locked():
>
> I don't really understand what the first half of that if condition is for (and
> I'm in a slight hurry to catch a train...).
all-in-one repositories share a control files between them, for them the
branch is never unlocked until the repo is also, so the 'if unlocked'
clause would never fire. So I preserved their behaviour.
> > === modified file 'bzrlib/tests/lock_helpers.py'
> > --- bzrlib/tests/lock_helpers.py 2009-03-23 14:59:43 +0000
> > +++ bzrlib/tests/lock_helpers.py 2009-04-15 05:39:38 +0000
> > @@ -44,6 +44,12 @@
> > self.__dict__['_allow_read'] = True
> > self.__dict__['_allow_unlock'] = True
> >
> > + def __eq__(self, other):
> > + # Branch objects look for controlfiles == repo.controlfiles.
> > + if type(other) == LockWrapper:
>
> Use “is” to compare types.
Sure.
Thanks,
Rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20090415/4e9bb4d2/attachment-0001.pgp
More information about the bazaar
mailing list