开发者

How to avoid tree conflicts when merging branches that were moved?

I have a repository that looks like this:

/a/trunk/Library
/a/branches/FeatureX/Library
/b/trunk/Application
/b/branches/FeatureX/Application

I want to rearrange this so that I have the Application and Library folders next to each other:

/a/trunk/Library
/a/trunk/Application
/a/branches/FeatureX/Library
/a/branches/FeatureX/Application

I tried to achieve this by simply "svn copy"-ing the "Application" folders. The problem I'm facing is that when I try to merge "FeatureX" into "trunk" later on, I get a tree conflict because "Application" was added in both trunk and the branch.

Is there a better way to do this?

(BTW i cannot merge "FeatureX" before copying "Application", this is just a test开发者_Python百科 to see if it will be possible later on...)


OPTION 1: Merge the changes from trunk (aka /b/trunk/Application) to your /a/branches/FeatureX. That should you give you an 'original' Application folder in the FeatureX branch. Then do a delta merge taking /b/trunk/Application and /b/branches/FeatureX/Application and merging those changes to a working copy of /a/branches/FeatureX/Application. That should allow you to then cleanly merge /a/branches/FeatureX to /a/trunk.

OPTION 2: Don't svn copy /b/trunk/Application to /a/trunk. Rather svn copy /b/branches/FeatureX/Application to /a/branches/FeatureX. Then merge those changes to /a/trunk when you are ready. If there are changes in /b/trunk/Application that are not in /b/branches/FeatureX/Application, you'll want to re-base that branch before doing the svn copy over to /a/branches/FeatureX.


OPTION 3: Based upon your comment for the previous answer, try this. Do a SVN copy of /b/trunk/Application to a/trunk/Application. Do a tree merge of /a/trunk from the revision you created /a/branches/FeatureX with to the latest (more than likely HEAD) of /a/trunk that contains the Application directory and apply that against your working copy of /a/branches/FeatureX. Commit those changes. Now do another delta merge of /b/branches/FeatureX/Application to /a/branches/FeatureX/Application against your working copy of /a/branches/FeatureX/Application. Commit those changes to the repository. You should have all of the changes in /a/trunk that were in /b/trunk and all of the changes in /b/branches/FeatureX in the /a/branches/FeatureX and ready to be merged back to /a/trunk when you are ready. However, you will loose the direct history of all commits from /b/branches/FeatureX/Application in /a/branches/FeatureX/Application. You can still see the history from /b/branches in /a/branches with -g option with the svn log command.


Do your svn copy to trunk only of "Application." Create a new branch from trunk: featurex2. Merge featurex to featurex2. Remove featurex its an attractive nussaince now.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜