Thoughts on file ids

John Arbash Meinel john at arbash-meinel.com
Mon May 9 14:08:16 UTC 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


...
>>> The tuples we use for versionedfiles are already repository
>>> implementation details, aren't they?
>> They are now, but that's a relatively recent change.
> 
> Before now, they were part of the model?

I'm pretty sure we have code (like with annotate, or 'bzr log file')
that assumes you can do:

 file_id = tree.path2id(path)
 _, ie = tree.iter_entries_by_dir([file_id]).next()
 revision = ie.revision
 key = (file_id, revision)
 texts = tree.branch.repository.texts
 texts.get_parent_map([key])
 record = texts.get_record_stream([key]).next()

etc. (That you can take a file_id you got elsewhere, add it to
ie.revision to get a key to look it up in the repository.)

I don't know exactly where in the code, but we don't have a
InventoryEntry.get_text_key() that abstracts how to go from an Inventory
to an actual text that you extract from the repository.

We might be close to that, though.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk3H9VAACgkQJdeBCYSNAAOaJQCgn4rxok+h725rJURm8uiwnkzq
vRsAoKD5hwJ6XqGZi+/IxxVPy00/Qk7U
=i49q
-----END PGP SIGNATURE-----



More information about the bazaar mailing list