java 如何在 NetBeans 中切换 Subversion 存储库?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10873473/
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
How to switch Subversion repositories in NetBeans?
提问by wmdvanzyl
I've been using NetBeans for a project and hosting a Subversion repository at riouxsvn.com, but recently the servers just went down and have been ever since. Since the servers are down, I couldn't import it into assembla using their Import from URLfeature. So now I need to check the code in at the new repository at assembla.com, but using the menu options Team> Relocategives me the following error:
我一直在为一个项目使用 NetBeans,并在 riouxsvn.com 上托管了一个 Subversion 存储库,但最近服务器刚刚宕机,从那以后就一直存在。由于服务器已关闭,我无法使用从 URL 导入功能将其导入程序集。所以现在我需要在 assembla.com 的新存储库中检入代码,但是使用菜单选项Team> Relocate会出现以下错误:
org.tigris.subversion.javahl.ClientException: svn: The repository at 'https://subversion.assembla.com/svn/opmtoolset' has uuid '36c7bd81-9045-4dfa-9d2c-2ba0fa0ee7f3', but the WC has '7f9aa1f8-8c2b-44dd-b220-ac62e04eeab0'
You are probably trying to relocate to a wrong repository. Your working copy has been created from a different one. Check the URL again.
You may also checkout the target repository and create a new working copy.
org.tigris.subversion.javahl.ClientException: svn: ' https://subversion.assembla.com/svn/opmtoolset'的存储库有 uuid '36c7bd81-9045-4dfa-9d2c-2ba0fa0ee7f3',但 WCa 有 '7f9a -8c2b-44dd-b220-ac62e04eeab0'
您可能正在尝试重新定位到错误的存储库。您的工作副本是从另一个副本创建的。再次检查网址。
您还可以检出目标存储库并创建一个新的工作副本。
I understand the basic message, but I am unsure of how to resolve it. I get that I now have two repositories (the new one is obviously empty) and the UUIDs differ, but I was hoping that telling NetBeans that I want to relocate would be the way to go.
我了解基本信息,但我不确定如何解决它。我知道我现在有两个存储库(新存储库显然是空的)并且 UUID 不同,但我希望告诉 NetBeans 我想重新定位是可行的方法。
So my question is: Is there a way to tell NetBeans that I want to use a new URL for my repository?
所以我的问题是:有没有办法告诉 NetBeans 我想为我的存储库使用一个新的 URL?
Secondary questions: If repositories (clearly) don't work the way I expect them to, how do I get around this problem? Do I make a new project in NetBeans and check all the code in again at the new host? In that case, what does the Relocatefunction in NetBeans do?
次要问题:如果存储库(显然)不像我期望的那样工作,我该如何解决这个问题?我是否在 NetBeans 中创建一个新项目并在新主机上再次检入所有代码?在这种情况下,NetBeans中的Relocate函数有什么作用?
回答by wmdvanzyl
Is there a way to tell Netbeans that i want to use a new url for my repository?Yes, if the old repository is still available, use the Netbeans Relocate function. If the old repository is no longer available, then there is no way to swap out the repository URL and keep using the same working copy. You will have to create a new working copy that accesses the new repository. However, you can retrofit the current working copy by deleting all instances of the .svn directories as Jim Garrisonsuggested. Then, in Netbeans, use Team->Subversion->Check into Repository and enter the new repository url.
有没有办法告诉 Netbeans 我想为我的存储库使用新的 url?是的,如果旧存储库仍然可用,请使用 Netbeans Relocate 功能。如果旧存储库不再可用,则无法换出存储库 URL 并继续使用相同的工作副本。您必须创建一个访问新存储库的新工作副本。但是,您可以按照Jim Garrison 的建议,通过删除 .svn 目录的所有实例来改进当前的工作副本。然后,在 Netbeans 中,使用 Team->Subversion->Check into Repository 并输入新的存储库 URL。
If repositories (clearly) don't work the way i expect them too, how do i get around this problem?Working copies are linked to repositories. If you want to change repositories, changes will need to be made to the working copy. Alternatively you can use the Relocate function provided by Netbeans, given that the old repository is still available. Also, you can use the retrofit solution mentioned above instead of creating a new project in Netbeans.
如果存储库(显然)也没有按照我期望的方式工作,我该如何解决这个问题?工作副本链接到存储库。如果要更改存储库,则需要对工作副本进行更改。或者,您可以使用 Netbeans 提供的 Relocate 功能,前提是旧存储库仍然可用。此外,您可以使用上面提到的改造解决方案,而不是在 Netbeans 中创建新项目。
Do i make a new project in Netbeans and check all the code in again at the new host?You canmake a new project in Netbeans and copy all the source files into the new project. Afterwards you can check the new project into the new repository, thus creating a new working copy. However, as was already explained above, it is not necessaryto create a new project if you follow the retrofit solution.
我是否在 Netbeans 中创建一个新项目并在新主机上再次检查所有代码?您可以在 Netbeans 中创建一个新项目并将所有源文件复制到新项目中。之后,您可以将新项目签入新存储库,从而创建新的工作副本。但是,如上所述,如果您遵循改造解决方案,则无需创建新项目。
In that case, what does the "relocate" function in Netbeans do?The relocate function in Netbeans addresses the problem of changing repositories on a working copy, but only works if the old repository is still available. It can not relocate a working copy into a repository, but simply move one repository into another one, thus saving you the effort of a manual transfer. It couldn't work for this scenario, since the first repository was no longer available. If the repository you are using goes offline, you willlose your history and you willneed to check code into a new repository as if for the first time.
在那种情况下,Netbeans 中的“重定位”功能有什么作用?Netbeans 中的重定位功能解决了在工作副本上更改存储库的问题,但只有在旧存储库仍然可用时才有效。它不能将工作副本重新定位到存储库中,而只是将一个存储库移动到另一个存储库中,从而节省您手动传输的工作量。它不适用于这种情况,因为第一个存储库不再可用。如果您使用的存储库脱机,您将丢失历史记录,您需要像第一次一样将代码签入新的存储库。
回答by Jim Garrison
If your original repository is gone forever, then what you need to do is check in the current working copy into the new repository as new source. The simplest way to do this is
如果您的原始存储库永远消失了,那么您需要做的是将当前工作副本作为新源签入新存储库。最简单的方法是
- Make a complete backup of the current source
- Delete all the .svn directories anywhere in your working copy
- Create the top-level directory in the new repository and check it out
- Move the old tree (to the new top-level directory)
svn add
the source to the new repository- Check in
- 对当前源进行完整备份
- 删除工作副本中任何位置的所有 .svn 目录
- 在新存储库中创建顶级目录并查看
- 移动旧树(到新的顶级目录)
svn add
新存储库的源代码- 报到
As ChristopheD pointed out, you'll lose your history, but that's already gone.
正如 ChristopheD 指出的那样,你会失去你的历史,但这已经消失了。