23

Our svn repo's location was changed to a different url, and in addition the relative paths of trunk, branches, and tags were moved a little. Now when I try to svn relocate, I get this message.

Invalid relocation destination: 'https://my-repo-server/new-proj-name/branches/my-branch' (does not point to target)

I tried relocating to the url of the repo, and tried again with the url of the branch I wanted to switch to. I did not try with switch --relocate as that is deprecated in my version of svn.

I believe this would have worked had the folder structure not also been changed.

5
  • Is it actually the same repository in a new location or a new repository with the same code? Are the UUIDs the same with svn info? Commented Jan 25, 2015 at 16:14
  • It is a new repository with the same code and history. Essentially, we split the repository in two; one for front-end code and one for back-end. Commented Jan 25, 2015 at 18:18
  • That's why "relocate" does not work. Relocate only works when you move the hosting of the same repository to a new location; one of the checks it performs before allowing the relocate to proceed (detailed in the svn book), is to compare the UUID of the old repository to the new repository. Commented Jan 26, 2015 at 16:12
  • Hmm, that might be it. However, it seemed to occur for both repos, one of which was the original but with half the files removed and path renamed. Nevertheless, you're probably right. I'm guessing in the svn source, "invalid relocation destination" is the generic error message for a UUID mismatch. Commented Jan 26, 2015 at 16:22
  • 1
    I'm seeing the same issue and can verify that the repo UUIDs match but the repo structure is slightly different in the location I'm trying to move to. Essentially the repo itself was copied to a new location then trunk/branches/tags where moved from a sub directoyr to the root of the repo. At this point I tried to relocate to the new location (same UUID) with no success. Commented Mar 31, 2015 at 12:47

3 Answers 3

21

Solved it with a stopgap solution -- from within the root of the working copy, deleted the .svn folder and ran svn checkout <new-url-of-branch> .

If anyone has a better answer that doesn't involve deleting the .svn folder, I will select it.

Sign up to request clarification or add additional context in comments.

1 Comment

I had tu use the --force parameter.
11

According to TortoiseSVN the relocate command shouldn't be used if:

You want to switch to a different branch or directory within the same repository. To do that you should use TortoiseSVN → Switch.... Read the section called “To Checkout or to Switch...” for more information.

Therefore, you should perform svn switch https://my-repo-server/new-proj-name/branches/my-branch since you are moving within the same repository.

Comments

1

(This was meant as comment to @AlexMA's own answer, but some ended up on its own.)

Maybe one can edit the wc.db inside .svn directory with sqlite3 CLI. But first one has to find out the structure of the database to edit the relevant tables directly via SQL - simply dumping wc.db, editing the dump file, loading back as with the repository results in a working copy no longer recognized as such. But this may open further issues. After all the working copy is regarded as dispensable by the SVN developers, so better update the WC to the last revision of the old repository, checkout a new WC from the new repository at the same revision, then copy all uncommitted modifications from old to new WC and recreate any changelists.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.