[RFC] Tree.iter_changes

John Arbash Meinel john at arbash-meinel.com
Wed Sep 20 20:36:03 BST 2006


Aaron Bentley wrote:
> Hi all,
> 
> So, I decided to stop grousing about how we constantly reimplement tree
> comparison, and do something about it.  I'm looking for feedback,
> especially from Robert, since he's working on dirstate.
> 
> This API is intended to be a performant, universal, tree comparison routine.
> 
> Tree.iter_changes(from_tree, include_unchanged=False,
>                   specific_file_ids=None)
> 
> I think the parameters are fairly clear.  I should mention that
> providing specific_file_ids means that other file ids will not have any
> comparison performed.  (No system calls.)

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.

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

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)

John
=:->

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060920/8f71acac/attachment.pgp 


More information about the bazaar mailing list