user files in branch/checkout/repositories

Robert Collins robertc at robertcollins.net
Thu Jan 26 22:50:29 GMT 2006


So there was a short thread a while back about giving all the object
types that serialise to a directory on disk an interface for adding,
removing and writing unversioned files.

I've had a think about this and chatted with Martin too - there are two
key problems:

 * Its not reasonable to expect all implementations of the -for
instance- 'Repository' interface to support unversioned file-like
storage. I.e. consider the foreignbranches work - a svn repository
always commits to record content, so this would conflict rather badly
with that model. Ditto CVS. And when I consider the 'revisions are
written as a single blob' storage approach, it seems to me it will have
problems too.

 * Whatever files are stored in our control directories we wont know
about them, and they may conflict with future names we choose. Are they
relevant to one repository format? or are they transient?

One approach to the latter problem is to require registering them:

>>> checkout.get_user_file('shelf')
...
UnregisteredFile: shelf
>>> checkout.register_file('shelf', preserve_clone=True,
preserve_upgrade=True)
>>> checkout.get_user_file('shelf')
.file object.

(implicit registration is not as clean IMO though it could be done).

This would allow upgrades and clones to copy such files around.

It does not address possible conflicts with names we might choose(we can
punt on this), nor does it address whether its a reasonable burden to
place on the objects.

Its obviously trivial for checkout, less so for branch, and IMO non
trivial for repositories.

Rob


-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060127/1afe282e/attachment.pgp 


More information about the bazaar mailing list