Technical Leader

CVS Relocate

Many times I have needed to relocate a Subversion repository. This is relatively easy in Subversion, there is a ‘svn relocate’ command. A stipulation of this command is the new locations repository must match identical to the old repository.

I recently needed to change (relocate) the server name of a CVS repository at a clients site. I found a small example which used a Perl script. I do not really have a problem with this … if I had Perl. The build box is a Linux environment, but my development environment is Windows XP.

I had installed cygwin previously, but choose not to install Perl (shockingly none of the items I installed had Perl has a dependency either). So I used the following in cygwin:

find -path '*/CVS/Root' -exec sed -i 's/oldcvs.example.com/newcvs.example.com/' '{}' ;

I’m sure somebody has a better/faster way, and I would love to see it. But this worked for me quite well.