PATCH: cache basis inventory in .bzr
Aaron Bentley
aaron.bentley at utoronto.ca
Mon Dec 19 20:02:30 GMT 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
John A Meinel wrote:
> Should get_basis always succeed, even if it isn't cached? That seems
> generally useful to me.
> Also, I wish there was some way to mark that the basis-inventory needed
> to be updated. get_basis_inventory() shouldn't be deleting or modifying
> the file (it is a readonly operation, and has to be, because it will be
> called from other readonly operations).
I'm not sure what do do about that. It may be that get_basis_inventory
is *logically* read_only, but that we actually do write it atomically.
If the basis we want isn't there, we read the branch data, write the
basis (if we can), and return the branch data.
> For now, it should be updated after something happens which modifies it
> (pull/commit).
We could have a WorkingTree.set_basis() function which would update it.
> The other nice thing would be to read just the first line, and make sure
> it was the right version, before going through the effort of actually
> parsing the inventory.
> I can think of a regex that should do a decent job.
> Is it worth implementing, or is it just a hackish workaround?
Seems on the hackish end, but if it makes a significant difference,
maybe it's worth it. When I proposed storing the inventory-id in the
file, I was thinking of storing it in plaintext on the first line, then
starting the XML after that, which is also hackish.
Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFDpxHW0F+nu1YWqI0RAjh6AJ4qSESMRM6Xqn8EOEtWRVX47yr/hgCdE2YB
X7H0NQFbP8llm7N3w6QhfV0=
=NLK5
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list