Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Subversion merge info, how important is it?

Tags:

svn

svn-merge

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?

like image 918
joscarsson Avatar asked Mar 23 '12 07:03

joscarsson


2 Answers

Merge info keeps track of this information:

  • The relations between branches (subbranch1 originated from branch1, which originated from trunk, etc.)
  • Which revisions have been already merged

If the merge info is missing or incorrect, you would have to track merges manually, and this could be error prone. By using merge info, you just let Subversion keep track of all this information.

like image 138
2 revs, 2 users 80% Avatar answered Oct 04 '22 22:10

2 revs, 2 users 80%


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).

like image 22
Christian Strempfer Avatar answered Oct 04 '22 21:10

Christian Strempfer