tags:

views:

12840

answers:

8

I had a feature branch of my trunk and was merging changes from my trunk into my branch periodically and everything was working fine. Today I went to merge the branch back down into the trunk and any of the files that were added to my trunk after the creation of my branch were flagged as a "tree conflict". Is there any way to avoid this in the future? I don't think these are being properly flagged.

Thanks.

+14  A: 

Subversion 1.6 added Tree Conflicts to cover conflicts at the directory level. A good example would be when you locally delete a file then an update tries to bring a text change down on that file. Another is when you you have a subversion Rename of a file you are editing since that is an Add/Delete action.

CollabNet's Subversion Blog has a great article on Tree Conflicts.

Gary.Ray
Neither of these examples you give pertain to my situation. Perhaps my description is not clear?
Greg
A: 

If you encounter tree conflicts which do not make sense because you didn't edit/delete/come anywhere near the file, there is also a good chance that there was an error in the merge command.

What can happen is that you previously already merged a bunch of the changes you are including in your current merge. For instance, in trunk someone edited a file, and then later renames it. If in your first merge you include the edit, and then in a second merge include both the edit and the rename (essentially a remove), it will also give you a tree conflict. The reason for this is that the previously merged edit then appears as your own, and thus the remove will not be performed automatically.

This can occur on 1.4 repositories at least, I'm not sure whether the mergetracking introduced in 1.5 helps here.

Ticcie
A: 

Is there a solution to this? Ever since I updated subversion to 1.6.6, I get tree conflicts with "local add, incoming add upon merge" on EVERY single merge I try to do.

I just created a branch off trunk, made zero commits to trunk, and later attempted to merge my topic branch into trunk. I fail to see how there could be any conflicts, yet, there are 14 (one for every directory). I have found elsewhere that I need to use "--accept working", but why do I need to do this on every merge? I am clearly missing something.

Lou Z.
This should be a separate question, but I'm experiencing the same thing.
Kev
+3  A: 

Are you using the same version clients all over? Using a v 1.5 client and a v 1.6 client towards the same repo can create this kind of problem. (I was just bitten myself).

kaleissin
+4  A: 

I don't know if this is happening to you, but sometimes I choose the wrong directory to merge and I get this error even though all the files appear completely fine.

Example:

Merge /svn/Project/branches/some-branch/Sources to /svn/Project/trunk ---> Tree conflict

Merge /svn/Project/branches/some-branch to /svn/Project/trunk ---> OK

This might be a stupid mistake, but it's not always obvious because you think it's something more complicated.

Smarb
+1 This was exactly my issue. Stupidly had the wrong URL for the FROM. Subclipse confuses it by showing the log comments even when you set the path to the parent.
Damo
A: 

In my experience, svn creates a tree conflict WHENEVER I delete a folder. There appears to be no reason.

I'm the only one working on my code -> delete a directory -> commit -> conflict!

I can't wait to switch to GIT.

I should clarify - I use subclipse. That's probably the problem! Again, can't wait to switch...

shmimpie
A: 

I came across this problem today as well, though my particular issue probably isn't related to yours. After inspecting the list of files, I realized what I had done -- I had temporarily been using a file in one assembly from another assembly. I have made lots of changes to it and didn't want to orphan the SVN history, so in my branch I had moved the file over from the other assembly's folder. This isn't tracked by SVN, so it just looks like the file is deleted and then re-added. This ends up causing a tree conflict.

I resolved the problem by moving the file back, committing, and then merging my branch. Then I moved the file back afterward. :) That seemed to do the trick.

Dave
+2  A: 

I found the solution reading the link that Gary gave (and I suggest to follow this way).

Summarizing to resolve the tree conflict committing your working dir with svn client 1.6.x you can use:

svn resolve --accept working -R .

where . is the directory in conflict.

gicappa