svn branch merge tree conflict issue (using tortoise)

a 夏天 提交于 2019-12-22 16:29:49

问题


I have read a lot and lot on this but couldn't figure out what the issue is, and it's pretty weird. I am using version 1.7 for server and latest tortoise version (1.7) for the client. Here's the scenario:

  1. I created a parent branch, and then created 1 child branch from it. So, PARENT_BRANCH -> CHILD_BRANCH
  2. Add a new directory in CHILD_BRANCH and commit.
  3. Using tortoise merge all changes from CHILD_BRANCH to PARENT_BRANCH. I used 'merge a range of revisions' option and didn't specify any revisions in the option, so basically let svn identify and manage the revisions to merge.
  4. After the merge, the new directory is created in PARENT_BRANCH.
  5. Merge back from PARENT_BRANCH -> CHILD_BRANCH.
  6. I get tree conflict on the new directory, with the error that the directory its trying to add is already there.

Well, of course the directory is there in child branch as that's where it originally came from. I though that svn 1.5+ tracks merges using merge-info, and should have known this is the branch from where the directory came and should not throw the tree merge error.

Any idea what's going on and how can I fix this? The example I gave is just for 1 directory, but in reality there are lots of directories and files, so going one by one manually takes hours.


回答1:


The problem is that both CHILD and PARENT have different revisions which added the same folder. CHILD doesn't have any knowledge of the revision in your step 4.

Immediately after every merge from CHILD to PARENT (your step 4.) you need to record against CHILD that it has the revision of the merge from CHILD to PARENT. You do this by merging that revision in PARENT to CHILD and checking this flag in tortoisesvn:

Have a read of this post on subversion branch reintegration.




回答2:


SVN is a tool that can be used in a lot of different ways. Some use cases are well supported and others are not. Merging in both directions continuously between two branches belongs to the latter category.

For this reason, SVN is not suitable for all projects. However, it works quite well for most projects, because there is no need to merge changes in both directions. The typical workflow with SVN is as follows:

A feature branch is created, changes are made to the feature branch and all changes from the originating branch are merged to the feature branch, so that the feature branch contains everything from the originating branch plus some additional features that only exist on this particular feature branch. As soon as the feature branch is complete, it is reintegrated with the originating branch, and closed.

This workflow is well supported by SVN and works quite good in most projects.



来源:https://stackoverflow.com/questions/16367990/svn-branch-merge-tree-conflict-issue-using-tortoise

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