Subversion Merge: How to Cleanly Re-integrate a ‘Definitive’ Branch

svn

We have been experimenting with a new technique to manage our release branches.

Generally, we maintain our current release on the trunk, and create release branches for each release. The release branch is where active development usually occurs, and the trunk is used for bug fixes on the current release.

We have been periodically merging the bug fixes from the trunk into the release branch (weekly).

Now that we are ready for another release, we would like to merge the release branch into the trunk. Unfortunately, this leads to many conflicts (> 50). At first I was surprised, but now I understand that Subversion cannot easily rectify the changes in the branch with what exists in the trunk.

Is there a way to tell Subversion to use all of the versions of the files in the branch when integrating back into the trunk? We know that the branch versions of files are 'correct'.

As an alternative, we could theoretically abandon the trunk and just work off of the branch(es) – branching from the branch for releases.

We use TortoiseSVN and Subclipse.

Best Answer

From the output of svn help merge:

--accept ARG

specify automatic conflict resolution action ('postpone', 'base', 'mine-conflict', 'theirs-conflict', 'mine-full', 'theirs-full', 'edit', 'launch')

To accept the branch changes when merging to the trunk, you need the "--accept theirs-full" option.

I don't think TortoiseSVN 1.6.2 has an equivalent option in the GUI. You can still interactively resolve conflicts by selecting "use repository" as each conflict is encountered during the merge.