Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to 'fix' a SVN branch/tree conflict?

Tags:

I took over a software project and decided to put everything under SVN (on Assembla) using Tortoise SVN. The trunk is under ROOT. So the trunk contained the whole application (which I tagged 1.0). For my first big feature I created a feature branch named "dev".

I could merge changes in the trunk branch into the dev branch without problem (as I was doing small bug fixes). Once my feature was complete, I did a merge back into the trunk branch. Everything was working fin up to this point. The new code under ROOT showed the new feature properly. But then I did a commit (of the result of the merge) and now every time I try to do a merge from the root or from the dev branch, SVN complains about "tree conflict" on many files. Even files that I did not touch since the merge. I tried to resolve the conflicts, without success.

I'm the only developer, so I don't really care about major changes to the repository. But I still want to keep the history of all files if it's possible.

What would be the best way to fix this issue? Is there a way I could tag all the latest files in the ROOT trunk as the "definite" version of the file?


[EDIT] More information

  1. Yes, 'main' and 'trunk' is the same thing. I have clarified my question
  2. When you merged back from the feature branch, did you first do another merge from the trunk to aborb the latest trunk changes?" Yes. The trunk was up-to-date. And the dev branch had all the changes from the trunk.
  3. "everything got screwed up on committing": What I meant was that the commit was fine, but then as soon as I started doing merge from the trunk/to the trunk, SVN complains about 'Tree conflicts'.
  4. I have over 200 tree conflicts. So what I'm looking for is a "accept all" command

[EDIT] elhoim solution did not fix my problem. However, he was right with SVN version issues. Currently (2009-10-28), Assembla is using SVN v1.5.1 and my tortoiseSVN was v1.6. So that was the reason I was having so much tree conflict. I tried using the solution as provided by elhoim's link and it did not work (I tried a bunch of merge multiple times before trying the HEAD-to-HEAD merge. Some files didn't carry over to the root branch because of that).

Seeing that an HEAD-to-HEAD merge would still not work, I decided to simply delete all ".svn" files in my branch folder, copy the files into the ROOT folder and do a commit.

like image 438
Thierry-Dimitri Roy Avatar asked Oct 20 '09 00:10

Thierry-Dimitri Roy


People also ask

How do I stop tree conflict in SVN?

When you merge your branch back into the trunk, SVN tries to do the same again: It sees that a file was created in your branch, and tries to create it in your trunk in the merge commit, but it already exists! This creates a tree conflict. The way to avoid this, is to do a special merge, a reintegration.

What is SVN tree conflict?

Since 1.6 version SVN recognizes a new kind of conflict, known as a "tree conflict". Such conflicts manifest at the level of directory structure, rather than file content. Situations now flagged as conflicts include deletions of locally modified files, and incoming edits to locally deleted files.


1 Answers

This answer should help.

Else, do you use a tortoise SVN client 1.6.x? It seems it has problems if the SVN server is less than 1.5.6...

like image 117
elhoim Avatar answered Oct 24 '22 16:10

elhoim