Reputation: 569
Using svn 1.8, I cannot figure out what's the best way to do a reintegrate merge with cherrypicking (i.e. I don't want to merge all revisions back to the trunk). Everything goes smooth as long as I merge all revisions, like:
svn merge ^/branches/mybranch
Now I have one revision In my branch that shouldn't be merged back to the trunk, let's say my svn 'history' is like this:
rev 20: reintegrated branch => trunk
rev 21: added 'donotmergetotrunk.txt' to branch 'mybranch'
rev 22: added 'monkey.txt' to trunk
rev 23: added 'dog.txt' to branch 'mybranch'
rev 24: merged trunk => mybranch, monkey.txt added to branch
Now I want to reintegrate everything but revision 21 from mybranch to the trunk, but whatever I try, I keep getting the conflict
Tree conflict on 'monkey.txt'
local file obstruction, incoming file add upon merge
I have tried stuff like:
svn merge -r 21:24 ^/branches/mybranch
svn merge -r 1:20 -r 21:24 ^/branches/mybranch
Of course the conflict can be solved manually, but in real life I get many conflicts this way and solving them gets quite tedious.
How do you perform this merge without getting conflicts?
Upvotes: 0
Views: 2843
Reputation: 2671
When you merge branch to trunk, you should skip previous sync merges from trunk to branch.
Otherwise, subversion will try merge them back to trunk and this create conflicts:
monkey.txt was added to trunk in rev.22
rev.22 included in branch as rev. 24
then when you try merge branch to trunk, Subversion try apply rev.24 onto trunk and add monkey.txt. But it is already added! Conflict.
Also you can try to play with http://svnbook.red-bean.com/en/1.7/svn.branchmerge.advanced.html#svn.branchmerge.advanced.blockchanges for block some revisions from merging into trunk. But in this case, when you block all unwanted revisions and execute on trunk
svn merge ^/branches/mybranch
Subversion can threat as reintegrate merge (which apply all differences). I am not sure how Subversion 1.8 decide if this will be sync or reintegrate merge, it is better to play with.
Upvotes: 1
Reputation: 97282
In your easy case you have to merge -r 23:24
In more common case you can use smallest needed range in SRC in form -rN:M
and exclude unwanted revisions inside this range using reverse merge of changesets: -c -R
Upvotes: 1