简体   繁体   中英

SVN Switch with relocate in Eclipse

My question can be claimed to be an extension/similar to the question posted here .

basically, I need to do the same functionality using Eclipse plugin Subclipse. Subclipse has a functionality to "Switch branch/tag/revision", however, this is limited as it treats the new url as a repository and tries to compare them. I only wish to change the URL.

any ideas!

From SVN Repository Exploring perspective right click on your project repository and choose Relocate.. from contextual menu:

在此输入图像描述

It will bring up a confirmation windows showing you active projects which will be affected by relocation.

In more recent versions of Eclipse/Subversive (which don't have the Relocate option) you can simply click Location Properties instead and change the URL. It will warn you that "The attached projects will be relocated because the repository root URL differs from the previously entered one." This is what you want!

上下文菜单的屏幕截图

I had the similar issue on Eclipse Luna 4.4.2 64 bit version. Initially I've relocated the project on the command line and Eclipse failed to recognize the relocation change. Alternatively I've tried to delete and re-import the projects, but sadly this approach failed to work out as well. Then sorted it out this way;

  1. Closed all the projects,
  2. Opened the SVN Repository Exploring perspective,
  3. Right clicked on the repository >> Location properties,
  4. In the properties pane, I've changed the url and in the below I choose "Use the repository URL as the label" clicked on finish,
  5. Switched back to the Java perspective and reopened the projects.

After this alteration Eclipse stopped giving such errors and I was able to see the new root address of each project on the right side of the name

I found that if the projects that are related with the SVN you are trying to relocate are open in Eclipse, the operation fails with the following error in the 'SVN Console':

switch --relocate http://old.scm.com/svn/APP http://new.scm.com/svn/APP .../webapp
    svn: E155019: Cannot relocate '...\webapp' as it is not the root of a working copy
    svn: E155019: Cannot relocate '...\webapp' as it is not the root of a working copy

The solution was to close all the projects (Project Explorer -> right click on the project -> Close Project) and only after that, do the URL relocation in the SVN window (SVN Repositories window -> right click on the URL of the old SVN -> Relocate).

Notice that that the box 'Projects that will be relocated:' on the following screen is empty. Before it showed all the open projects in Eclipse IDE.

This was they only way I got it to succeed.

Using Eclipse Kepler Service Release 2, with Subclipse 1.10.10.

在Eclipse Kepler中重新定位屏幕

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM