PATCH: cache basis inventory in .bzr
John A Meinel
john at arbash-meinel.com
Mon Dec 19 18:55:03 GMT 2005
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.
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).
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?
John
=:->
>
>>> The current/last revision is a property of *both* the working tree and a
>>> branch. Right now because we have everything pushed together, we don't
>>> record both separately. Ultimately, I think we'll need 2 records.
>
> Agreed.
>
>>> Especially considering checkouts, where there is no branch, and they can
>>> very easily get out of sync.
>
> But when the checkout gets out of sync, it's more useful to have the
> checkout basis inventory than to have the branch basis inventory. And
> of course, it's possible that there is more than one checkout, with some
> more up-to-date than others.
>
>>> Another way of thinking is what happens when you push to a branch and
>>> can't update the working tree (because there isn't one).
>>> I think the basis-inventory should point to the newly pushed revision.
>
> If we need one at all.
>
>>> Certainly some of this could be moved around if you convince me that it
>>> does need to be a WorkingTree property.
>
> Convinced?
>
> Aaron
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051219/b400ef5a/attachment.pgp
More information about the bazaar
mailing list