Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use Eclipse Refactoring Tools and stay in sync with SVN through Subclipse?

I have found that when I need to rename a Java class (and therefore the source file) or need to change the package name (and therefore move the source file[s]), I can either:

  1. Use the nice and useful Eclipse refactoring tools which is great since all the cascading tasks are done for me. However, I then have an uphill struggle with Subversion to replicate the changes back to the repo.
  2. I can issue the renames/moves in Subversion first, update my local and then the refactoring tools in Eclipse don't work.

Can anyone advise on a preferable procedure?

like image 251
Nicholas Avatar asked Feb 05 '09 20:02

Nicholas


People also ask

What is synchronize with repository SVN Eclipse?

Synchronize with Repository is something similar to svn status -u , but even more. It will open a Synchronize tab (or perspective) that displays overview of your local (outgoing) modifications versus repository (incoming) modifications.

How to use Subclipse plugin in Eclipse?

Installing Subclipse In Eclipse, go to "Help » Install New Software..." from the toolbar. We are currently running Subversion version 1.10. x, so you need to place the link http://subclipse.tigris.org/update_1.10.x in the "Work with" field and press Enter. Select "Subclipse" and click the "Next" button.

What is subclipse Eclipse?

Subclipse is an Eclipse plugin that provides project integration with Subversion repositories. Using Subclipse you can checkout, browse, and share code from any Subversion repository.


2 Answers

Since the 1.4.x releases, Subclipse handles this pretty well. If you have bugs, please report them. In prior releases it handled some situations but not others. This was due to Subversion limitations that were fixed in SVN 1.5. For example, prior to SVN 1.5, if you renamed a folder, you could not also rename a file in the folder (until the folder was committed). These sorts of things were all very common refactorings and SVN would get in the way.

It all works pretty well now though.

Mark

like image 65
Mark Phippard Avatar answered Sep 19 '22 05:09

Mark Phippard


I hate to walk in and say 'ur doin it rong', but since your subject line mention Subclipse - Subclipse integrates with Eclipse's refactoring tools. So does Subversive. When you rename a class, it executes the 'svn mv' for you underneath. You should never need to attempt to replicate those moves manually.

I wonder if for some reason Subclipse is not attaching to your project - if it doesn't know your project's a Subversion project. Then obviously it wouldn't do anything.

If you're not using Subclipse/Subversive... start. :)

like image 35
John Stoneham Avatar answered Sep 20 '22 05:09

John Stoneham