开发者

svn merging trunk to branch: all paths are tree conflict

I can't seem to make a branch and then merge trunk changes into the branch:

svn copy file:///svn/project/trunk file:///svn/project/branches/feature-branch
svn co file:///svn/project/branches/feature-branch
cd feature-branch
#change a couple of files, no additions/deletions
svn commit
svn merge file:///svn/project/trunk

With thi开发者_开发问答s, every single path in the branch is listed as a tree conflict (svn status shows "local add, incoming add upon merge"). The merge does list that it's merging from r2 onward on trunk...so it looks like svn copy is not actually keeping the history of when the branch diverged from the trunk? This is the workflow listed in the subversion book for 1.5, is 1.6 a completely different workflow? (Using 1.6.11)

Edit: svn log -v shows:

A /branches/feature_branch (from /trunk:3091)

svn proplist is empty. (perhaps because I haven't resolved the tree conflicts?) Changes in the feature branch don't seem to be in the log, either, and r3091 isn't in svn log -v. The merge message is "Merging r2 through r3093 into '.'" so it looks like the problem is with remembering where the fork is. After deleting and recreating the branch several times, we've given up on using svn branches.


I was having the same problem. After doing a lot of research, I found out that in SVN servers prior to 1.5, the branches won't have merge information stored in the servers. So, whenever you try to do a merge in your branch, it'll try to sync from revision 1 up to HEAD. Since you probably have new files in your branch that were not in trunk r1, you'll have those many tree conflicts. There are two solutions: using revisions range in merge command (svn merge -r 1234:HEAD http://trunk) or updating your svn server to a version grater than or equal 1.5, in which it keeps information about merges, so whenever you try to do a merge in your branch, it'll know which was the last revision synchronized and will do the merge only from that one.


I'd expect this to be working fine (at least it does for me, using v1.6.13.19776). If this is a test repo, can you post the output from on the feature-branch:

svn log -v

There should be a copy entry something along the lines of:

D:\svntest\feature-branch>svn log -v
------------------------------------------------------------------------
r6 | XXXX | 2011-04-21 08:04:21 +0100 (Thu, 21 Apr 2011) | 1 line
Changed paths:
   A /project/branches/feature-branch (from /project/trunk:5)

test branch
------------------------------------------------------------------------

Which shows that it's tracked 'feature-branch' being created from 'trunk'.

It's also worth checking the output from:

svn proplist

I'd expect this to be empty before you've attempted to merge from the trunk, however afterwards (assuming it's worked correctly), you should have a mergeinfo property:

D:\svntest\feature-branch>svn proplist
Properties on '.':
   svn:mergeinfo

Which you can then query:

svn propget svn:mergeinfo

Again, if everything is working correctly, this should be updated to indicate the 'trunk' revisions that have been upmerged into the branch, something like:

D:\svntest\feature-branch>svn propget svn:mergeinfo
/project/trunk:6-7


When you merge make sure you commit the root directory. On this directory properties you have the revision number that was merged and if you don't commit it you will have conflict on next merge.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜