[MERGE] apply_inventory_delta

John Arbash Meinel john at arbash-meinel.com
Tue Mar 27 14:10:14 BST 2007


Aaron Bentley wrote:
> Martin Pool wrote:
>> On 3/27/07, Aaron Bentley <aaron.bentley at utoronto.ca> wrote:
>>> This patch implements MutableTree.apply_inventory_delta, which should
>>> replace the need for WorkingTree._write_inventory.  It was based on my
>>> knowledge of TreeTransform's needs and Robert's knowledge of dirstate's
>>> needs.
>> That sounds good.
> 
> Cool.  Do you have a review for this particular patch?
> 
>> Yes, I think add could do with a good scrub out; I may do it this
>> week.  What I had in mind basically is that there would be a core that
>> generates a list of to-be-added files,
> 
> Don't forget the list of ignored files, too.
> 
>> and then we connect up various
>> callbacks to that.  
> 
> I think just returning the two lists might be enough.
> 
>> At the moment we have this strange 'reporter'
>> thing which seems like it would almost be enough to set whether things
>> are actually added or not.
> 
> IIRC, the "action" object used to control whether the operation was a
> dry run or not.
> 
> Aaron

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.

Originally the 'smart_add' code would check every record to see if the
parent had been added, and would recurse as needed. This was partially
because when save=False, it couldn't modify the inventory. The change
meant that smart_add new that parents would be present because it always
added in a particular order. (It validates the user arguments first, and
then knows it iterates in a safe order).

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.

John
=:->



More information about the bazaar mailing list