[rfc] removing LockableFiles

Martin Pool mbp at sourcefrog.net
Mon Jul 9 01:14:50 BST 2007


On 7/6/07, Aaron Bentley <aaron.bentley at utoronto.ca> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Martin Pool wrote:
> > So I propose to change things so that Branch, WorkingTree, Repository
> > components just have a _transport and a _lock, and then to delete this
> > class.
>
> Seems okay to me.  It will mean enhancing some classes to take over
> functionality from LockableFiles, e.g. setting permissions.

Yes, I think it would make sense to have the code for default
permissions in Transport - either in a base class, or maybe in a
decorator that you can wrap around a transport.  It would be like the
way you can set this on the local filesystem with umask(), setfsuid(),
g+s and so on.  (I don't mean it would directly correspond to those
calls or use them, just that it seems reasonable for your interface to
the filesystem to know that new files should be created with
particular permissions as a kind of stateful default.)

> If control_files goes away, TreeTransform will need a new strategy for
> interacting with limbo.
>
> I suppose one option would be for WorkingTree to provide a get_transform
> method.  That would allow WorkingTree implementations to supply
> different TreeTransform implementations.  I'm thinking of MemoryTree and
> a potential RemoteTree.
>
> That may be a YAGNI at this point.  For one thing, WorkingTree could
> just provide get_limbo_path.

Thanks for pointing that out.  It looks like all it does is basically
use the control_files to find the directory path.  The smallest change
would be to just ask _transport for its local path, but as you say
allowing the workingtree to directly know about limbo directories may
be cleanest.

-- 
Martin



More information about the bazaar mailing list