File is shown as deleted while merging branch to trunk

五迷三道 提交于 2019-12-07 12:31:54

问题


i am merging branch to trunk using tortoise svn option Merging Two Different Trees

I have file i.e file1 under trunk but not on branch

I have checked out trunk to my local .then did Right- click > Merge > Merging Two Different Trees > mentioned from as trunk url and to as branch url > Test merge

Now file1 is shown as deleted under Test merge results but why ? Ideally it should ask me that this file does not exist under branch but exist on trunk. Do you want to keep it or not ? Is there an option of doing it ?

UPDATE :-

on 1st june i created the branch from trunk. on 5th june i added the file1 under trunk. Now when when i am trying to merge branch to trunk, should it be displayed as deleted ?


回答1:


If you created the branch from trunk and then deleted the file in the branch it is counted as change after the branching date. So like the other changes that you want to merge you merge this one too (deleting the file).

If the file is deleted in separate commit you can merge without this revision (you specify which revisions to merge in turtoise).

Also you merge locally and then you commit the merged version. So the deleted file is deleted only in your local computer. When you commit the merge to the repository you can uncheck the deleting of the file or revert the deleting of the file. This way the trunk will still have the file.




回答2:


If you follow instruction if TSVN help for reintegrate via 'Merging Two Different Trees' than it can be easily explained. You ask apply difference between trunk - branch to working copy.

File exists in trunk but absent in branch, then difference - 'delete file'

This difference applied to working copy and silently (no conflicts here) delete file.

Also you can check that after merge your working copy should look exacly as branch. This is what reintegrate merge doing - make destination branch ('trunk' in your case) equal to source barnch.

If you still want perfrom reintegration merge via 'Merging Two Different Trees', then first perfrom sync merge trunk -> branch. In this case branch will contains both trunk and branch changes and reintegrate will look like copy branch changes into trunk (but again, actually it is made trunk equal to branch)



来源:https://stackoverflow.com/questions/31110196/file-is-shown-as-deleted-while-merging-branch-to-trunk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!