在 Eclipse 中重新定位的 SVN 开关

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6979872/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 20:24:24  来源:igfitidea点击:

SVN Switch with relocate in Eclipse

eclipsesvnsubclipsesvn-switch

提问by M. Faraz

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.

基本上,我需要使用 Eclipse 插件 Subclipse 来完成相同的功能。Subclipse 具有“切换分支/标签/修订版”的功能,但是,这是有限的,因为它将新 url 视为存储库并尝试比较它们。我只想更改 URL。

any ideas!

有任何想法吗!

回答by Vlad

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

SVN Repository Exploring 的角度,右键单击您的项目存储库,然后从上下文菜单中选择Relocate..

enter image description here

在此处输入图片说明

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

它将弹出一个确认窗口,显示将受搬迁影响的活动项目。

回答by Greg McCoy

In more recent versions of Eclipse/Subversive (which don't have the Relocateoption) you can simply click Location Propertiesinstead 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!

在较新版本的 Eclipse/Subversive(没有Relocate选项)中,您只需单击Location Properties并更改 URL。它会警告您“附加的项目将被重新定位,因为存储库根 URL 与之前输入的不同。” 这就是你想要的!

Screenshot of contextual menu

上下文菜单的屏幕截图

回答by Tugrul ASLAN

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;

我在 Eclipse Luna 4.4.2 64 位版本上遇到了类似的问题。最初,我在命令行上重新定位了项目,但 Eclipse 无法识别重新定位更改。或者,我尝试删除并重新导入项目,但遗憾的是这种方法也未能奏效。然后就这样整理了;

  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.
  1. 关闭所有项目,
  2. 打开SVN Repository Exploring视角,
  3. 右键单击存储库 >> 位置属性,
  4. 在属性窗格中,我更改了 url,在下面我选择“使用存储库 URL 作为标签”,点击完成,
  5. 切换回 Java 透视图并重新打开项目。

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

在此更改后 Eclipse 停止出现此类错误,我能够在名称右侧看到每个项目的新根地址

回答by BirdOfPrey

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':

我发现如果与您尝试重定位的 SVN 相关的项目在 Eclipse 中打开,则操作会失败,并在“SVN 控制台”中出现以下错误:

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).

解决方案是关闭所有项目(项目资源管理器-> 右键单击​​项目-> 关闭项目),然后才在SVN 窗口(SVN 存储库窗口-> 右键单击​​旧的URL)中进行URL 重定位SVN -> 重新定位)。

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.

请注意,以下屏幕上的“将重新定位的项目:”框是空的。之前它显示了 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 Service Release 2,以及 Subclipse 1.10.10。

Relocate screen in Eclipse Kepler

在 Eclipse Kepler 中重新定位屏幕