[MERGE] Make TreeTransform update the tree inventory on kind changes
Aaron Bentley
aaron at aaronbentley.com
Sat Aug 2 22:03:40 BST 2008
James Westby wrote:
> On Fri, 2008-08-01 at 12:39 +1200, Aaron Bentley wrote:
>> James Westby wrote:
>>>> Instead of adding a new kind_change state, you should add a check in
>>>> apply_insertions to see a kind changes has occurred.
>>> That's what I originally went for. However, the files have already been
>>> moved to libo by that point, so I couldn't get the old kind through
>>> self.tree_kind(). I'll look for a way to get that tomorrow.
>> Oh, I hadn't thought of that. So maybe kind_change should be calculated
>> in TT.apply_insertions before doing apply_deletions, and passed into
>> apply_insertions.
>
> That seems like a similar amount of work, can I ask why you prefer
> this approach?
>
> Is it that having the book-keeping is more likely to cause bugs?
More or less. Managing more state is more work and a maintenance
burden, both in terms of fixing bugs and when adding new features.
Additionally, having redundant state creates the risk of having an
inconsistent state.
There was an additional issue: it was gathering kind_changed data even
when it wasn't necessary to trigger generation of a new inventory entry.
While the new code isn't better in that regard, it at least does not
mandate generating kind_changed data for all files/symlinks/dirs with
new contents.
>> create_hardlink is morally equivalent to create_file. The --hardlink
>> code won't change a file kind, but other callers could create hardlinks.
>
> However, we don't have a hardlink kind in inventories, so it will
> be the same as ->file kind changes I assume?
Right.
Aaron
More information about the bazaar
mailing list