How to switch Subversion repositories in NetBeans?

15,040

Solution 1

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

  1. Make a complete backup of the current source
  2. Delete all the .svn directories anywhere in your working copy
  3. Create the top-level directory in the new repository and check it out
  4. Move the old tree (to the new top-level directory)
  5. svn add the source to the new repository
  6. Check in

As ChristopheD pointed out, you'll lose your history, but that's already gone.

Solution 2

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 Garrison suggested. Then, in Netbeans, use Team->Subversion->Check into Repository and enter the new 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.

Do i make a new project in Netbeans and check all the code in again at the new host? You can make 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 necessary to create a new project if you follow the retrofit solution.

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 will lose your history and you will need to check code into a new repository as if for the first time.

Share:
15,040
wmdvanzyl
Author by

wmdvanzyl

Updated on June 05, 2022

Comments

  • wmdvanzyl
    wmdvanzyl almost 2 years

    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 URL feature. So now I need to check the code in at the new repository at assembla.com, but using the menu options Team > Relocate gives me the following error:

    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.

    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.

    So my question is: Is there a way to tell NetBeans that I want to use a new URL for my repository?

    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 Relocate function in NetBeans do?