[cvsnt] Yet another obscure merge problem

Tony Hoyle tmh at nodomain.org
Tue Feb 24 17:39:25 GMT 2004


On Tue, 24 Feb 2004 17:14:10 -0000, "Harrison, Andrew"
<andy.harrison at anite.com> wrote:


>When a user does a tag or branch, CVS goes through the directory structure
>and adds a new symbol to the RCS file of every currently active file in the
>current branch. If it finds a file that was marked as deleted in the current
>branch it does not add the new symbol to it. So, if that new symbol is used
>in future, CVS cannot find a revision of that file associated with that
>symbol. This is fine if doing an update or check-out as it simply does not
>get (or it deletes) the file. However, as you have pointed out, it causes a
>problem when merging.

That's not the issue (rtag handles deleted files - the purpose of tag
is to tag the sandbox which is why it doesn't care about deleted
files).

>For a file that is added in Branch1 but not in Branch2, you would still get
>the situation that there is no revision at the branch point. However since
>this is now the only case were this could happen then you know that the file
>has been added in Branch1 rather than deleted in Branch2 and can deal with
>it accordingly.
>
Not really.  Symbols don't make this any different.

There is no way at all to do this automatically even if there *is* a
revision at the branchpoint.

Let's say you have:

1.1
  |
1.2 ----- [Branch1] ----------------------[Branch2]
                  |                                      |
               1.2.2.1			1.2.4.1
                  |                                      |
               1.2.2.2 (deleted)             1.2.4.2
                                                         |
                                                      1.2.4.3

How to you merge branch1 into branch2?  It's impossible - you can't
know whether deleting the file is a valid action,  so you do nothing,
and flag up a warning.  Similarly you can't merge branch2 into
branch1.

If revision 1.2 is a deleted revision you have an automatic conflict,
since there are two adds to deal with.

For the deletion/addition to make any sense there must be no changes
at all to the target branch since the last common ancestor.  This is
the only case where any kind of automatic delete/add works.

Tony








More information about the cvsnt mailing list