branch locking mk2.

Martin Pool mbp at sourcefrog.net
Tue Feb 21 06:01:05 GMT 2006


On Tue, 2006-02-14 at 05:31 +0200, Nir Soffer wrote:
> Some more comments and questions:
> 
> INFO_NAME = '/info'
> 
> self._info_path = path + self.INFO_NAME
> 
> 	transport expect to get posix like path e.g foo/info?

Yes.

> def is_held(self):
> 	...
> 
> 	Maybe use read only property instead:
> 
> 		def __init__(self):
> 			self._is_held = False
> 
> 		is_held = property(lambda self: self._is_held)
> 
> 
> 	Which will make the client code more readable:
> 
> 		if lock.is_held:
> 			...

Good point.

> The module docstring is excellent, it misses example usage of the 
> locks. For example, how to create and lock, how to get a lock with 
> blocking etc.

Good point.

> Last, this is a problem I see in other places in bzr, it will be hard 
> to reuse this code in another project, because it uses lot of 
> bzrlib.stuff. For example, instead of defining LockContention and 
> friends in lockfile, they are defined in bzr.errors, so code that want 
> to reuse this code will have to either import bzr.errors, or rewrite 
> those errors. Same for the transport - if you want to use this code for 
> the file system, you have to import bzr.transport

The default assumption, as Robert says, is that bzrlib will be reusable
as a whole but not split into parts.  We can split it in future if
there's a compelling reason.

Thanks for the review.
-- 
Martin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060221/8c20e1bc/attachment.pgp 


More information about the bazaar mailing list