[MERGE] apply_inventory_delta

John Arbash Meinel john at arbash-meinel.com
Tue Mar 27 17:42:08 BST 2007


Aaron Bentley wrote:
> John Arbash Meinel wrote:
>> Aaron Bentley wrote:
>>> IIRC, the "action" object used to control whether the operation was a
>>> dry run or not.
>> It did. IIRC it changed because it was causing us to search around all
>> the time because we had to make sure parents were added before children.
> 
> Could be.  Switching to the apply_inventory_delta approach would mean we
>  wouldn't care about ordering, so long as all parents were added.

I think there would still be a sanitation step, since you have to handle
"bzr add dir/file" (which adds both), and "bzr add dir/subdir dir" which
shouldn't add anything twice.



> 
>> It actually seems like it would be good to have another api like
>> "iter_changes". 'smart_add' basically just needs an 'iter_unknowns', and
>> do something with them.
> 
> The difference from iter_changes is that it would list unknowns
> recursively?  What about ignored files?
> 
> Aaron

Well, originally I thought to use iter_changes, but I realize it does
one other very important thing. It doesn't care about *versioned* files.
So while we care whether an entry is versioned or not, we don't need to
look at any contents to see if anything has changed. Theoretically, we
don't even need to stat the entry (but realistically we do because we
need to know if it is a dir or file, and since we "support" kind changes
now...) I guess it would be a case where the 'readdir' optimization
would certainly help, since we wouldn't need to stat at all.

John
=:->



More information about the bazaar mailing list