[MERGE] apply_inventory_delta

Martin Pool mbp at sourcefrog.net
Wed Mar 28 04:18:31 BST 2007


On 3/27/07, John Arbash Meinel <john at arbash-meinel.com> wrote:
> 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.

There is a bit more than just unknowns; if we decide to add a
previously unknown directory we need to descend into it, which
unknowns does not do, and that needs to be done properly with regard
to multiple arguments to add.  But I agree an iterator should
basically do it, and it can be a lot cleaner.

-- 
Martin



More information about the bazaar mailing list