Wednesday, July 16, 2008

Eclipse & CVS in Windows

As you might have guessed I'm a Linux fan, and I'm using it most of the time, especially when I program. I'm also a big eclipse lover! However, sometimes I happen to have to use windows for programming and there's no problem concerning eclipse, since it runs perfectly on windows. Eclipse also provides an excellent CVS integration, but concerning this point I've always found that it is a big lacking that you can only use remote CVS servers and not local repositories... Well, I know that CVS is thought for collaborative programming, but I'm using it also to store all the versions of programs I work on alone (and I know many others do like this). Of course, under Linux it's a not big problem, since you install a local ssh server. But in Windows I had always experienced problems...

I then decided to go back to WinCVS, http://wincvs.org, which I had been using for a long time before eclipse came. During the installation, I noted that it was installing also CVSNT, a server for CVS under Windows. My problems with trying to setup a CVS server under windows were probably due to the fact that I was trying to use the one with cygwin which required an involved procedure (which never worked for me).

Well, CVSNT seemed to have solved all my problems! First of all you need to configure your repositories. Note that you can give the repository a symbolic name. This is pretty cool since it allows me to use the same path as in Linux


Then I checked the option "Pretend to be a Unix server", since the help says that programs like eclipse require this.


At this point, everything already worked fine, and I could access my local repositories from eclipse using pserver protocol, and using the user/password of Windows.

However, for C++ programs using autotools, I kept on having problems since the autotools scripts failed due to the \r\n DOS lines that seemed to be introduced during checkout.

Fortunately, this is easily solvable by configuring eclipse, by disabling "Convert text files using platform line ending" as shown in the following screenshot:


After a brand new checkout, everything worked like magic! :-)

2 comments:

Gio said...

I don't know anything about installing a local server on Windows, but I think you should consider switching to Subversion: it's far superior than CVS (IIRC you can't even rename a file in CVS!) and fully supported by Eclipse.

betto said...

Surely svn is much powerful than CVS, but I still prefer CVS for local repositories for just one programmer (just to store all the versions of documents, for instance), since it does not require a web server, and it is quite easy to backup it with rsync :-)