开发者

SVN merge vs. test merge - the results are not the same

I am trying to reintegrate a feature branch back into the trunk, but the "test merge" is not showing what the "real merge" is actually going to do. The "test merge" looks great, the "real merge" screws up my working copy.

The feature branch was made at rev 481 from the trunk. The trunk is now at rev 525. I have 开发者_开发知识库successfully synced the feature branch with all trunk changes from 481-524, so both trees are now at 525.

I begin the merge operation from the trunk folder, choosing "Merge two different trees" in Tortoise.

The "From:" box is the trunk url, revision set to 525.

The "To:" box is the feature branch url, revision set to 525.

The "Working copy" is set to the trunk url.

I click "Next" and then "Test Merge" and everything looks great in the test, so I do the real merge.

The real merge does all the changes that the test merge did, but then it also does more after that:

  1. After merging the differences betweeen the urls (which is all correct, per the test merge), it then says it is "Merging r481 through r525", which gives a bunch of tree conflicts.

  2. Then, it says its "Reverse merging 525 through 481", which doesn't give many errors, but it seems to undo a lot of changes I've made to the files.

My question is this: how can I do the merge, without it doing the second two steps? And, why does the test merge not show the second two steps? The point of the test should be to preview what will actually happen during the live merge.


I think I may have figured it out. I checked the "Ignore ancestry" option on the final merge screen and the merge worked. Based on my understanding of this option, it's not clear to me why this fixed it, but it did.


I have successfully synced the feature branch with all trunk changes from 481-524

In that case you should use the "Reintegrate a branch" merge option. From the section in the TortoiseSVN manual on merging:

Reintegrate a branch

This method covers the case when you have made a feature branch as discussed in the Subversion book. All trunk changes have been ported to the feature branch, week by week, and now the feature is complete you want to merge it back into the trunk. Because you have kept the feature branch synchronized with the trunk, the latest versions of branch and trunk will be absolutely identical except for your branch changes.

You should not use the feature branch anymore after this operation.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜