PATCH: cache basis inventory in .bzr
Robert Collins
robertc at robertcollins.net
Tue Dec 20 01:26:47 GMT 2005
On Mon, 2005-12-19 at 12:55 -0600, John A Meinel wrote:
> Aaron Bentley wrote:
> > John A Meinel wrote:
>
> ...
>
> >>> It makes perfect sense to me to have a
> >>> remote branch, which has no working tree, still have a basis inventory.
> >
> > The use case for a working tree basis inventory is to speed up diff,
> > status, commit, and the like. What's the use case for a branch basis
> > inventory?
>
> Yeah, I guess I had my thinking off. The basis inventory is well
> defined, but it isn't useful, because you won't need it for comparison.
> So I'll rework it to put get_basis_inventory back into WorkingTree.
>
> Should get_basis always succeed, even if it isn't cached? That seems
> generally useful to me.
Yes. The caching is not part of the contract here IMO.
> 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).
> For now, it should be updated after something happens which modifies it
> (pull/commit).
uhm, in the working tree we have various caches updated during readonly
locks - like the hash cache. I think the basis inventory is analogous to
the hash cache here - it can be atomically updated without corruption.
> 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?
Given the low frequency I'd expect mismatches to occur at : hackish
premature optimisation.
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/20051220/9917ad2c/attachment.pgp
More information about the bazaar
mailing list