Thoughts on file ids

Jelmer Vernooij jelmer at samba.org
Mon May 16 17:33:15 UTC 2011


On Tue, 2011-05-03 at 16:35 +0200, Jelmer Vernooij wrote:
> File ids have a couple of known issues; in particular (my pet peeve)
> they make parallel imports very problematic. They're also hard on
> foreign branch implementations which don't natively have the concept of
> file ids. And they're a blocker for file copies.
> 
> File ids currently seem to serve three fairly distinct purposes:
> 
> 1) as ways to get at files in the tree API
> 
> 2) as part of the keys to look up texts

> 3) as a way to determine equivalent files between different trees in
> merges
> 
> As far as I can tell there is nothing in the API that should really
> require the file identifiers in these three cases to be identical, and
> these three use cases have distinct requirements:
> ]
> (1) and (2) strictly require file ids to be unique and refer to one
> specific file/path. (3) in theory doesn't, although the current
> implementation probably does.

> (2) seems like it could be a repository implementation detail, and not
> something that needs to be exposed at the API level.   
After some recent changes, (2) is now a repository implementation
detail; quite a bit of the versioned file implementation still requires
it, but nothing outside of it does.

It would be nice to further decouple (1) and (3). It seems like there
are two main things (on an API level) that would need to be updated to
cope with this.

 * iter_changes() needs to yield not just one file id, but both the file
id in the old tree and the file id in the new tree; and everything that
currently relies on it would need to be updated 
 * tree transform (as mentioned in one of the other emails in this
thread) - needs to cope with files not having the same id in multiple
trees

get_file_graph should already deal with a file having different file ids
in different trees. 

Is there anything I'm missing, do these seem like reasonable ways to go
about this?

Cheers,

Jelmer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/bazaar/attachments/20110516/ed05e376/attachment.pgp>


More information about the bazaar mailing list