[rfc] revision-storage

John A Meinel john at arbash-meinel.com
Tue Dec 27 22:16:24 GMT 2005


Aaron Bentley wrote:
> Hi all,
> 
> I believe the revision-storage branch is mergeable, or close to it.
> 
> This branch introduces the API changes that will be needed to support
> repositories.  So while it only supports standalone branches, it
> contains a Repository object, which is used the way we plan to use real
> repositories.
> 
> It also introduces LockableFiles, which supplies controlfile,
> controlfilename, lock_write, etc.  In testing, I found a bug in
> LockableFiles.put_utf8, which I believe exists in the current BzrBranch
> version.  The bug is that the files are written as bytestrings, not as
> utf8-encoded text.  AFAIK, there is no library functionality that
> directly supports this.
> 
> Anyhow, please check out
> http://panoramicfeedback.com/opensource/bzr/revision-storage/
> if you find this kind of thing interesting.
> 
> Aaron

Some comments...

Why does LockableFiles take both a transport and a base directory, which
means that it has to call _rel_controlfilename everywhere. I realize
this is probably how it used to do it, but since transport objects
already have a base, that is what Transport.clone() is meant to do.

So in branch.py, instead of doing:
self.control_files = LockableFiles(transport, bzrlib.BZRDIR, 'branch-lock')

You could do:
self.control_files = LockableFiles(transport.clone(bzrlib.BZRDIR),
'branch-lock')

And then all of the LockableFiles code can be simplified.

I think the other reason we used to have _rel_controlfilename is because
we supported passing in a path as a list or as a string. Which we never
really needed > 1 path element anyway. And if we did, we have
standardized on using forward slashes inside bzrlib, so you can just use
"path/to/file".

So, I'm +1 to the concept of LockableFiles (which I assume will be used
to implement .bzr/branch, .bzr/repository, and maybe .bzr/checkout). I
just think it could be cleaned up a lot.

John
=:->

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051227/4443fbb9/attachment.pgp 


More information about the bazaar mailing list