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

Yes, 'main' and 'trunk' is the same thing. I have clarified my question

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.

"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'.

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.

@eldimo: when you merged 'main' into 'dev', was the 'main' branch identical to the trunk? Or were there changes sitting in 'main' that the trunk had not seen yet?
–
dlsOct 20 '09 at 1:43

1

@dls: I think he uses the terms "main" and "trunk" to mean the same branch.
–
Critical Skill Oct 20 '09 at 2:41

@eldimo: Need some details for better clarity: 1. When you merged back from the feature branch, did you first do another merge from the trunk to aborb the latest trunk changes? 2. What do you mean "everything got screwed up" on committing? Is it possible to supply the error message you got during the commit?
–
Critical Skill Oct 20 '09 at 2:47

It seems like some changes made at the level of the directory structure on the trunk were not absorbed into the dev branch before attempting the merge back into the trunk. This may have caused the tree conflict in your case.

Have you already run svn resolved on the workspace where you actually overwrote/resolved the conflicting versions?
There may be files/folders still marked "conflicted" on your problematic workspace (the one where you actually performed the merge ) - So once you have looked through those and resolved the conflicts by hand, you can run svn "resolved". I use the subversion command line client for my merges - but I have verified and this option is available on tortoise as well. This should knock off the conflict status and let you proceed. goodluck.

In general, SVN's merging support can only handle using a feature branch once. That is, you work in it and merge changes from trunk into it, and then use svn merge --reintegrate to merge it back into trunk when you're done.

After that, if you want to keep working, you need to create a new branch to work on. I think that you can delete the old one and make a new one in its place without losing data if you want to keep the same repository path, but you may want to try with a test repo first just in case the svn:merge info gets screwy.

This isn't perfect. See this post from when the current merge semantics were introduced for more detailed info.

Also, beware of any use of svn cp or svn mv for purposes other than branch and merge -- if you do this, you'll need to delete the spurious svn:merge properties they create (on both branch and trunk if need be) before running the reintegrate or it will fail will tree conflict messages.

On the whole, svn's branch and merge is still pretty weak compared to the distributed VCS family (git, hg, bzr, darcs, etc), but if you follow these guidelines it does the job.

We've been having this problem since 1.7 and I see the footnote in the SVN redbook live doc that this 'hit or miss' functionality of 1.5 and 1.6 sometimes spotting the obvious and fixing it for you. So it seems the only real solution after you've merged a feature branch (or CI release branch, in our case) back to trunk once with tree conflicts, the best thing to do is blow away the original branch and create a new one... But wait, that won't work for CI! What to do?!
–
Joey TSep 21 '12 at 22:06