Merging an entire branch back into the trunk can be a pain. I've found that if you only want to keep the changes made to the branch then the following steps should help. Using svnmerge.py makes the whole process a bit easier by automatically tracking revision number ranges. Information on svnmerge.py can be found
here: http://www.orcaware.com/svn/wiki/Svnmerge.py
Here are the steps:
Here are the steps:
- Begin by following the steps for merging the branch here (assumes you are using svnmerge.py):
http://www.orcaware.com/svn/wiki/Svnmerge.py#Merging_development_branches_back_to_trunk - Handle conflicts. If the branch is up-to-date, simply copy the latest revision file to the conflicted file. Example: Let's say the latest revision is 100 and after merging a branch to the trunk, conflicts are present. The following shell one-liner will automatically resolve the conflicts, but only if the branch version is authoritative. If the trunk version has features not yet added to the branch version, you must manually resolve the conflict.prompt:~# for a in *.r100; do b=`perl -e 'print split /\.merge-right.r100/, shift;' $a`; echo "copying $a $b"; cp $a $b; svn resolved $b; echo; done
If this makes you nervous you can always consult the manual: http://svnbook.red-bean.com/en/1.5/svn.tour.cycle.html#svn.tour.cycle.resolve - Commit the merge: svn ci -F svnmerge-commit-message.txt

Leave a comment