Changing your CVS host
February 5th, 2009
What do you do if the host name of your CVS server changes? For example, here’s my case. I checked out a whole lot of CVS modules from the repository while my laptop was on the domain. Now however, thanks to Vista SP1 not playing with an antiquated NT domain, the laptop can’t join the domain so to connect to a server I need to qualify its name with a domain. So, whereas I checked out the modules using the hostname “cvshost”, I now need to use “cvshost.mydomain.co.uk”.
Unfortunately, TortoiseCVS has no way to change the host names for modules you’ve already checked out. WinCVS can, supposedly, do this thanks to a macro. However, WinCVS stubbornly tells me I don’t have Python installed (I do) and therefore won’t let me use macros.
The solution is to just go through all the CVS “Root” files and change the host name. The Root file lives in the CVS directory at each level within a checked out module. This would be a laborious task by hand, but if you have SUA (Microsoft’s Subsystem for UNIX Applications) and Perl installed it’s easy. Just pull up a Korn shell and browse to the directory within which your checked out CVS modules live.
Run the following command.
find . -name 'Root' -print0 | xargs -0 perl -pi -e 's/oldhostname/newhostname/g'
For example, I ran the command:
find . -name 'Root' -print0 | xargs -0 perl -pi -e 's/cvshost/cvshost.mydomain.co.uk/g'
Which changed the Contents of the Root file from:
:pserver:achristie@cvshost:/company/repository
to:
:pserver:achristie@cvshost.mydomain.co.uk:/company/repository
Potentially similar posts
- Maintaining a Flare project in Google Code – January 2010
- Revealing Vista’s hidden Administrator account – November 2008
- Migrating a hosted WordPress site to your local PC – October 2008
- Solving disk space problems with SkyDrive – September 2008
- ITauthor blog’s esteemed readership – August 2008