[MERGE] Make TreeTransform update the tree inventory on kind changes
James Westby
jw+debian at jameswestby.net
Fri Aug 1 10:11:28 BST 2008
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?
> In fact, I've been meaning to move inventory delta generation to a
> separate function, but I certainly wouldn't expect that as part of this
> bugfix.
>
> >>> Also, I didn't add anything to the create_hardlink method, as
> >>> I think that is used in the --hardlink code, and I don't think
> >>> that it can be the cause of a kind change, is that correct?
> >> No, it's incorrect.
> >
> > Ok, I'll work out how to exercise this as well.
>
> 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? I need to write some
tests for this and play with it.
Thanks,
James
More information about the bazaar
mailing list