Saturday, May 9, 2009

Renaming an SVN repository and using --relocate

Consider the difference between, on the one hand, an actual SVN repository and, on the other, a mere working copy of that repository. With that distinction in mind, it might sometimes be desirable to change the name of the actual SVN repository. The Subversion Book in the section on moving and removing repositories makes clear that you need use only UNIX mv to do this.

mv repos newnamerepos

But this is only half the story. Any working copies that 'point' to this repository formerly known as repos but now known as newnamerepos will now be 'orphaned' and no longer know how to communicate with the repository.

The answer is in Subversion Book under the section on svn switch. The answer is the --relocate option.

svn switch --relocate svn://128.129.130.22/repos \
svn://128.129.130.22/newnamerepos

Make sure to specify only the URL part of the path to repository.

No comments: