[RFC] Tree.iter_changes

Aaron Bentley aaron.bentley at utoronto.ca
Wed Sep 20 20:59:33 BST 2006


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

John Arbash Meinel wrote:

> I haven't looked over the complete patch, but from my understanding, I
> think it is still a little bit too low level.
> 
> Specifically, dirstate is optimized for the case of 'compare current
> versus parents'. And I think we also have a similar possibility in our
> storage model. We want to be able to produce changes of this versus a
> parent, without having to create a complete inventory.

That aspect of dirstate is nice, but covering only that case is
inadequate.  Most commands that compare against basis can also compare
against any arbitrary revision.  (e.g. revert, status).

And some, (e.g. diff, merge --uncommitted) compare a working tree
against another working tree.

So from my POV, an interface that only supports diffing against parents
is too limited.

> For example, dirstate lets us iterate through the whole inventory, and
> compare against all parents as we go.

AFAIK, commit is the only command that can make use of that functionality.

> I wonder if it wouldn't be worthwhile to have an 'iter_changes' that
> only worked against the leftmost parent. Because I think it is
> frequently needed, and our storage models make it reasonably cheap to
> compute. (We could extract it without having to extract the complete
> inventories, and diffing them)

The patch implements the functionality as an InterTree method.  So if
the basis tree is a special type, e.g. a BasisTree or ParentTree, then
we can implement an optimizer for that case, to use dirstate in the most
efficient way possible.

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

iD8DBQFFEZ2l0F+nu1YWqI0RAvLlAJ46FE8PxgmY7v1LHZMK0AAAHuHh9ACfdHbA
Yr3FmTRHrGtckpy/qxWtPRw=
=M45b
-----END PGP SIGNATURE-----




More information about the bazaar mailing list