[RFC] Inventory delta support for CommitBuilder

Aaron Bentley aaron.bentley at utoronto.ca
Mon Aug 27 12:58:41 BST 2007


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

Ian Clatworthy wrote:
> Attached are some changes I'd like some feedback on before I proceed with:
> 
> * writing more supporting tests
> * making associated changes to commit.py.


> 1. The logic in apply_inventory_delta() on MutableTree should largely
>    move down to Inventory.apply_delta().

We want to stop exposing the concept of inventory as part of the public
API.  Tree.apply_inventory_delta is meant to assist in this transition.
 So this move would be against our larger goals.

>    BTW, as well as being called
>    inside builder.finish_inventory(), I want Inventory.apply_delta()
>    so that certain changes detected during commit processing (e.g.
>    SHAs & sizes of new files) can be passed back to the working tree
>    as an atomic transaction.

In particular, we want to reimplement apply_inventory_delta on WT4, so
that it doesn't require an inventory read.  So using
Inventory.apply_delta for the WT would be bad-- it would ensure we
continue to use Inventory on dirstate trees, instead of updating the
dirstate tree efficiently.

> 3. repository.get_commit_builder() should support a new flag indicating
>    what mode the CommitBuilder is to be used in: building the
>    inventory from scratch each time or otherwise. I think we need to
>    do this to provide a transition period for plug-ins to move to the
>    new incremental way of doing things.

That's an interesting idea.  When I took a run at incremental commits, I
tried to make the old-style commit builder be implemented as a client of
the new-style commit builder.

I think doing it your way is fine.

> Does that all make sense? If so, is it consistent enough with the
> direction being taken with packs & inventories? I'm guessing here that
> the above might just be an incremental step but it does seem a necessary
> one yes?

Step 2 seems to go against the purpose of dirstate trees, and also seems
to go against the idea that inventories will be provided as some kind of
delta in packs.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG0rxx0F+nu1YWqI0RAtbZAJ9ep1Vd0M+E3Kur5JKlUoq2qaNJmACeMe9l
H0qmV8MstgJrC++fxNV6xDc=
=+dba
-----END PGP SIGNATURE-----



More information about the bazaar mailing list