Eclipse – Subversion and Eclipse – branching, and merging with the trunk

eclipsesvn

I use v 3.4.2 of Eclipse and Subversion (using svn 1.4.6 on the server), and I'm having problems understanding the specific options (Depth, Ignore ancestry, etc) and how to merge changes from the trunk into the branch, and back again.

Also, when conflicting changes are present, Subversion seems to break – in the compare editor for the conflicting file, my Local File contains SVN text (e.g. <<<<<<< .working) which obviously don't appear in the actual working copy file. If I go back to my Resource view, I see a whole bunch of SVN temporary files. Is this a bug somewhere, or am I doing something wrong?

Best Answer

The "breakage" as you describe it is the standard way that subversion works - when the merge results in line conflicts, SVN keeps both sides of the conflicts and puts them in the source file for you to review. You have to edit your conflicted file, examine your version of the conflict vs. the repository's version and edit it so that only one set remains (remove the <<<< line, the >>>> line, the ===== line and all the conflicting code lines that you don't want to have). After that right click your source file and choose "mark as merged". following that you can commit your merged file. This is called manual merging and you must complete that when there are conflicts.

The bunch of temporary files are the original source files from either side and they should help you to resolve the conflict - you should have a file ending with ".mine" which is your original clean version of the source file and a file ending with ".rXXXXX" (where XXXX is a subversion revision number) which is the repository's original clean version of the source file. When you "mark as merged" these files will be gone.

Eclipse has a nice graphics tool that you can use to resolve the conflict using a compare style editor, but it has some quirks and it takes some practice and understanding of the tool in order to use it effectively. If you want to try it is available under the file's RMB menu->Team->Edit Conflicts.