Wednesday, August 27, 2003
Running a CVS server on Windows
The first thing to do was get a CVS server up and running. We’re a completely Microsoft office, so no simple “just install linux!” solution for us. Instead we had to install CVSNT, and the last time I tried this (about six months ago) it was impossible. After several attempts by myself and some of the other developers we gave up.
How things change.
The CVSNT I’d tried with before was 1.something, the current version is 2.0.8, and it’s an absolute snap. Within about ten/fifteen minutes of downloading and following the instructions on the installation page of the wiki we were up and running with full internal CVS access using all our favourite clients (emacs, tortoiseCVS, WinCVS, Eclipse).
The next thing to do was port over some of our Sourcesafe projects. For this I used Laine’s VSS2CVS which again was very simple to use, following the instructions given (the only downer being that you need to run it once for every project in the repository, so if you have many projects, this could take a while).
At this stage we had multiple projects checked into CVS which we could check out, edit and check back in, plus all the other CVS functions you’d expect. The problem now was that the author and creation date of each files in CVS were set to the user who did the import and the time the file was imported.
Fortunately, vss2cvs comes with a perl script called “massagecomments.pl” which takes care of this for you. During the normal vss2cvs process it stores the user history and creation date in the file comment. The massagecomments script restores these values to the CVS repository.
Less fortunately it only works on a single file at a time, and if you’ve just imported a decent number of files then you have a long job ahead of you. I didn’t fancy this, and so brought my insignificant perl skills into play to create “massage-runner.pl” (if you download it, you'll have to rename it to have a .pl extension and change the path in the first line which defines which path it should start from) which scans directories recursively searching for files ending in ”,v” and running massagecomments.pl on them. What can I say? It’s worked for me, running on multiple projects.
What this means is that if you’ve been looking to get away from using Sourcesafe at work, want to stop paying yearly renewals and don’t want to have to buy extra pieces of software to be able to access your code remotely and are having trouble convincing the boss, then give CVSNT a go. It’s a real alternative. We’ve now had it up and running for about a week and a half with daily use (although only light use, I confess) with no problems whatsoever.
Try it, you might like it.
p.s. DeveloperWorks have a good article on sharing code with Eclipse
p.p.s I should mention of course, that in order to use VSS2CVS you'll need both Perl and something like MinSys installed (or any other program that provides you with rm.exe and mv.exe, Cygwin will probably do the job), both of which we had installed already.