views:

81

answers:

1

Lets say I have a feature branch named "branches/BigFeature". I want to push those changes to the Trunk, make some changes to Trunk and merge back it all back into the "BigFeature" branch so development can continue.

My steps were to:

  1. Merge the latest changes in Trunk to branches/BigFeature. (Tortoise SVN -> Merge a range of revisions)

  2. Merge the changes in branches/BigFeature to Trunk. (Tortoise SVN -> Reintegrate a branch)

  3. Make some changes to Trunk.

  4. Merge the changes in Trunk to branches/BigFeatures. (Tortoise SVN -> Merge a range of revisions)

The problem arises in step 4. When I merge back to BigFeature I get all kinds of conflicts. It seems to have a problem with files that were originally added in branches/BigFeature but were merged to the Trunk.

The message it gives me is "The last merge operation tried to add the file 'blah' but it was already added locally.

This kinda makes sense because the file was originally added in the branches/BigFeature branch and then merged to Trunk. But why can't the merge operation realize this? Why is it coming up as a conflict?

The same kind of error happens for deleted files.

The last merge operation tried to delete/move/rename the directory 'blah', but it was deleted, moved or renamed locally.

Thanks for you help.

+2  A: 

Unfortunately it is a deficiency of svn, the way it is built.

The steps in svn must look like this:

1. (not modified) Merge the latest changes in Trunk to branches/BigFeature. (Tortoise SVN -> Merge a range of revisions)
2. (not modified) Merge the changes in branches/BigFeature to Trunk. (Tortoise SVN -> Reintegrate a branch)

2a. Delete branch branches/BigFeature
2b. Create branch branches/BigFeature from current trunk

3. (not modified) Make some changes to Trunk.
4. (not modified) Merge the changes in Trunk to branches/BigFeatures. (Tortoise SVN -> Merge a range of revisions)

SVN branch is no longer usable after a reintegrate operation.

Update: there is a second way, instead of deleting the branch.

2a. on branch: 
    $ svn update
    Updated to revision X
    $ svn merge --record-only -c X ^/trunk
    $ svn commit -m "Block revision X from being merged into the branch."

I did not know this trick, I learned it thanks to your question :D

silk
That's unfortunate. But hey at least its not just me:) And this work around should do the trick.
Justin
It's not necessary to delete and recreate branches all the time. You just have to construct the merge command properly to not re-merge everything you merged before.
Ether
Can you provide some insight as to how to do that? I'm ok with the cmd line but obviously would prefer if Tortoise SVN provided a means to do this.
Justin
Sorry, I do not have access to any windows machine with tortoise at the moment. I do not know if tortoise gives you access to this functionality.
silk