Search code examples
svnsvn-merge

Subversion merge info, how important is it?


I am a bit curious on how the merge info in Subversion is used, and what kind of problems one can run into if the merge info is incorrect?

For example, I have branched branch1 and branch2 from trunk. I also have a subbranch1 and a subbranch2 originating from branch1. Consider I've done some development in branch2, and then reintegrated it back to trunk using svn merge --reintegrate ^/branch2. I then wanted to add these changes to subbranch1 as well (pulling them from trunk) and mistakenly used command, svn merge --reintegrate ^/trunk (thus adding the --reintegrate flag to the merge command here too, even though subbranch1 is not an immediate ancestor of trunk).

What problems can this cause in the future?


Solution

  • This answer is deprecated. Please use Subversion >= 1.6.


    You're branching approach is dangerous in general, but because of the accident it's even worse.

    You'll get much problems when reintraging all the branches.

    • changes made by branch2 might look like deletions to subversion.
    • deletions made by you might look like additions to subversion.
    • the three-way-comparsion might give you odd results (putting the same piece of code twice into the file for example)

    You cannot trust the three-way-comparsion anymore, you have to check each change manually!

    See What mother never told you about svn branching and merging for more information.

    P.S. I had to fix something like this once. Since then we use bunny hopping (see link).