Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is merging a merge back a problem in subversion?

Tags:

merge

svn

Here's the situation: On a particular branch, some changes have been merged in from the trunk, and also changes to the branch have been merged back into the trunk.

The question I have is this: What, if anything, does the merge management in Subversion do if I try to merge back into the trunk from the branch a revision that was in itself just a merge from the trunk to the branch?

Will this cause problems? If so, what sorts? Or should this be a perfectly fine thing to do?

Or does the new merge just treat those changes like any other and simply try to apply them?

like image 335
cdeszaq Avatar asked Sep 02 '09 13:09

cdeszaq


1 Answers

It depends partially on what version of svn you are using.

Pre 1.5, there was no merge tracking at all, so you would have to merge the revisions you wanted back in. Most people used a script name "svnmerge" for that. You can use this if you want, and mark the revisions you've already done as merged - after that, svnmerge will give you some help in picking the right revisions and skipping those already merged.

1.5 (and later) gives some merge tracking, but it is not yet full featured. In your particular case (merging both ways), I don't think svn's tracking can handle it. You will probably need to merge each revision you want back and forth manually.

Personally, when I'm on projects using svn, I prefer to make branches somewhat short-lived, and only merge one way (trunk to branch) until the final merge from branch to trunk. Once I've done that, I either merge everything into the trunk and close the branch, or I merge what I want and close the branch. Hardly ever do I keep the branch alive, due to possible merge issues (it's easy to make a mistake).

like image 176
Philip Rieck Avatar answered Sep 24 '22 17:09

Philip Rieck