PATCH: cache basis inventory in .bzr
Johan Rydberg
jrydberg at gnu.org
Fri Nov 25 06:21:30 GMT 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Robert Collins <robertc at robertcollins.net> writes:
> Couple of things: the code for this should be in WorkingTree, not
> Branch. (Its a property of the WorkingTree that it is at revision X, and
> thus that the cached inventory has value FOO.)
True. I will move it into WorkingTree.
> So, I think that having a method on WorkingTree 'set_last_revision',
> which takes care of this, would be a good idea. The data does not need
> to be cached in the object, just blatted to disk. This allows the
> branch.set_revision_history method to call
> self.working_tree().set_last_revision(history[-1]) for now...
The reason I went with a more fine grained approach was to try to
eliminate the need to read the inventory from the weave right after it
has been written. The normal procedure for adding a revision is:
- record revision
- record inventory*
- update history via branch.append_revision
* The new basis inventory is known and in memory
But being more fine grained might introduce some security risks. What
if append_revision fails for some reason, but the new basis inventory
has already been written to disk? With the current implementation of
append_revision this can probably not happen, though.
~j
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>
iD8DBQFDhq1q3CqIy3K3X2ERAi6pAKC7218kR/N8w+B0tuQrk2IGsOIGsQCfetXW
/VkZHW368cbRSSnpC6ve+5Q=
=YgCk
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list