Why do conflicts arise when merging a branch with Trunk, and then merging it with a branch?

Suppose I have a feature branch named "branch / BigFeature". I want to move these changes to Trunk, make some changes to Trunk and merge everything back into the BigFeature branch to continue development.

My actions were as follows:

  • Combine the latest changes in Trunk with branches / BigFeature. (Tortoise SVN -> Combine Patch Range)

  • Combine changes in branches / BigFeature in Trunk. (Turtle SVN β†’ reintegrate branch)

  • Make some changes to Trunk.

  • Combine changes in Trunk with branches / BigFeatures. (Tortoise SVN -> Combine Patch Range)

The problem occurs in step 4. When I return to BigFeature, I get all kinds of conflicts. It seems that the problem is with files that were originally added to the / BigFeature branches, but were merged with Trunk.

The message it gives me is "The last merge operation tried to add a blah file, but it has already been added locally.

This view makes sense because the file was originally added to the / BigFeature branches and then merged with Trunk. But why can't this merge operation understand this? Why does this happen as a conflict?

The same error occurs for deleted files.

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

Thanks for the help.

+6
branch merge svn conflict tortoisesvn
source share
1 answer

Unfortunately, this is the drawback of svn, the way it is created.

The steps in svn should 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) 

the SVN branch can no longer be used after the reintegration 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 recognized it thanks to your question: D

+7
source share

All Articles