开发者

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 c开发者_开发问答ommand-line, or TortoiseSVN?


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.


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


What you mention is indeed a limitation. I normally checkout the whole folder structure and then import the individual projects into eclipse. When I need to do an operation on the whole repository, I do it outside from eclipse using either the command line or Tortoise SVN.

It is also a pain, that when someone adds a new plug-in (I am developing an Eclipse RCP application), I need to manually add it to the project list as Eclipse does not know about the root of all the projects.


In Eclipse, SVN branching and merging works nicely for single projects, I have not had any issues when dealing with single projects that have been branched and need to be merged.

However, if multiple projects need to be dealt with a single unit, then this does not seem to be possible to deal with directly in eclipse, each project would need to be dealt with individually.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜