Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to merge large projects in Eclipse?

I've been working with branches for quite some time now, but I always used command-line tools to do the actual merging. However, now I need to do it from Eclipse only. Branching and merging being a widely used feature of SCM systems for many years now, I expected Eclipse to have good had support for it, but it just doesn't seem to be the case.

Currently I'm working on a product that is built up of several projects that need to be branched together. When merging changes from trunk to a branch, normally I would execute the following from the root of the branches checkout: (I'm using Subversion as an example here, but the problems should apply to other SCM tools as well.)

svn update
svn merge ^/trunk
svn commit -m "Merged from trunk"

Maybe fix some conflicts in the middle, but that's about all I have to do. However, in Eclipse I can only merge on the project level, which has the following disadvantages:

  • I cannot merge the contents of the root folder, only the contents of the individual projects. Same goes for updating, BTW.
  • If the project structure is modified on trunk (e.g. a new project has been added), those changes don't get merged at all. Same for update, again.
  • The merge is not atomic. If a commit happens on trunk during the merge, things can get messed up in my working copy. (This can be worked around, but not conveniently.)

These limitations seem pretty straightforward from the fact that Eclipse does not know about the root folder, as it checks out individual projects from SVN.

My question is: am I missing something, or is it really impossible to use Eclipse in a way similar to what I'd do from the command line? And if it is indeed impossible, then how do others cope with this? Does everyone use external tools like the command-line, or TortoiseSVN?

like image 834
Lóránt Pintér Avatar asked Jan 15 '10 14:01

Lóránt Pintér


2 Answers

Your observation is correct. Eclipse manages "team" operations like svn on project level only. So, you're not missing anything ;-)

Yes, you have to use external tools for merging whole branches. Tortoise does it nicely.

like image 158
Wolfgang Avatar answered Sep 29 '22 09:09

Wolfgang


Multi-project merging can be done with the Eclipse plugin CollabNet Subversion Merge Client. You can find it at com.collabnet.subversion.merge.

Enable it in the preferences:

Eclipse Preferences > Team > SVN > Diff/Merge 

and there: Merge Implementation: CollabNet Desktop

like image 26
sina72 Avatar answered Sep 29 '22 09:09

sina72