attn: abentley Re: [BUG] Merging repositories with a directory deleted

Harald Meland harald.meland at usit.uio.no
Wed Sep 14 23:18:57 BST 2005


[Aaron Bentley]

> Aaron Bentley wrote:
>> What I really need is a comprehensive exception-handling spec.  So far,
>> I've just been handling each case as it bit people, based on vague ideas
>> of 'the right way'.
>
> So I'm looking at it now, and I can see why I never handled it before:
> Let's say, worst-case scenario, the file doesn't exist in THIS, and some
> of its parent directories are also missing.
>
> 1. Do I use BASE or OTHER for the path?

If the file exists in BASE, but not in THIS, it must have been
explicitly deleted from the branch we're merging into.  My gut feeling
is to regard that deletion as a wish for not having the same file
resurrected by a merge.

If it doesn't exist in BASE, but does exist in OTHER, it must have
been added to the merge-from branch after it diverted from the
merge-into branch, and should be added to THIS.  As it doesn't exist
in BASE, one must refer to OTHER for the path.

> 2. Do I use the exact path from that tree, or do I invent a path by
> iterating up through parents in OTHER/BASE until I find something that
> exists in THIS?

Assuming that only the "absent in BASE, present in OTHER" case is
relevant, and the file in question is e.g. foo/bar; if the foo/
directory has been renamed to fnord/ in THIS, I would expect the added
file to appear in THIS as fnord/bar.

I'm not sure what to do if foo/ has been deleted between BASE and
THIS, though; would it be possible to put the file in a
"unknown"-class directory and mark the tree as conflicted?

> 3. When I make the directories, do I also add them to the inventory
> of THIS?

I'm not sure I understand this question; which directories are you
referring to?

> 4. What do I do if there's something in the way?

If both THIS and OTHER added a file with the same path, the file from
OTHER should be treated the same way one would treat files added to
directories which have been deleted in THIS; see my
question/suggestion above.
-- 
Harald




More information about the bazaar mailing list