Pagine

Monday 9 January 2017

SVN tutorial n 26 - relocate

Sometimes an administrator might change the location (or apparent location, from the client's perspective) of a repository. The content of the repository doesn't change, but the repository's root URL does. The hostname may change because the repository is now being served from a different computer. Or, perhaps the URL scheme changes because the repository is now being served via SSL (using https://) instead of over plain HTTP. There are many different reasons for these types of repository relocations.
The svn relocate command has two syntaxes:
The first svn relocate syntax allows you to update one or more working copies by what essentially amounts to a find-and-replace within the repository root URLs recorded in those working copies. Subversion will replace the initial substring <from-prefix> with the string <to-prefix> in those URLs.
 svn relocate <from-prefix> <to-prefix> [<svn_path>]
Example:
 svn up
Updating '.':
svn: E180001: Unable to connect to a repository at URL 'file://var/svn/repos/myproject/trunk'
 svn relocate file:///var/svn/new-repos/myproject/trunk
The second syntax does not require that you know the current repository root URL with which the working copy is associated at all—only the new repository URL (<to-url>) to which it should be pointing. In this syntax form, only one working copy may be relocated at a time.
 svn relocate <to-url> [<svn_path>]
Example
 svn relocate http://new-svn-host.com/repos/myproject/trunk

No comments:

Post a Comment