People often complain that they cannot checkout files from a public CVS repository because they are behind a corporate firewall that blocks access to the pserver. The standard workaround, use ssh, works only for registered users, not anonymous users. Some firewall support also http tunelling, where access to the pserver is possible with a standard CVS client, but unfortunately it is not used or allowed in all organisations (or even with personal firewalls).
CVSGrab is another kind of CVS client. When other CVS clients use the cvs protocol or ssh to read the repository, this utility reads the repository via its web interface, such as ViewCVS or CvsWeb.
The advantage is that if you are behind a firewall that prevents you from updating files from a remote CVS server, this program will be able to bypass the firewall and download the latest files from the repository.
Disadvantages are that you have only read access to the
repository, the repository needs to be public and have
ViewCVS set up.
Also, it adds a more important load on the web server, so try to use this tool reasonably.
Never use CVSGrab on a site that supports Subversion (aka SVN), as this version control system can use http for communication and it's not blocked by firewalls.
CVSGrab can be started either from the command line or from an Ant task.
It starts by reading the top page of the ViewCVS repository, then parses the links in this page and browses all the pages below while downloading the files in them.
In addition, the CVS administration files (the files under the Cvs folder present on every directory) are created and store the version number for each files. The next time you run CVSGrab, those version numbers are used to download only the files that have being updated.
The detection of web interfaces has been improved, and now to start cvsgrab, you need only to give the full url of the web repository to download.
For example, to download the latest version of Ant in its 1.6 branch, you may use only
cvsgrab -url http://cvs.apache.org/viewcvs.cgi/ant/?only_with_tag=ANT_16_BRANCH
This is much simpler, the -rootUrl, -packagePath, -versionTag and -cvsroot parameters are now optional.
But sometimes the autodetection may fail, so it's still possible to use the old style:
cvsgrab -rootUrl http://cvs.apache.org/viewcvs.cgi/ -packagePath ant -tag ANT_16_BRANCH
Now you can create a patch file when you modify source code that has been checked out with CVSGrab.
For that, run cvsgrab -diff from your project root, and a file called patch.txt is created that contains your modifications in the unified patch format. The file is compatible with the command cvs diff -u that is the standard for submitting patches for most open source projects (see Apache's guidelines
Let's suppose that you connect your notebook behind a firewall that blocks cvs. Now, you want to download the latest code from project X, which is still under development and with some blocking bugs in their latest release.
To check out files, you use cvsgrab with the -cvsRoot parameter. This parameter is the equivalent
of the -d parameter on the cvs command. for example, if you use this command to check out files without a firewall:
cvs -z3 -d:ext:firstname.lastname@example.org:/cvsroot/cvsgrab co cvsgrab
then the cvsgrab command to use should be:
cvsgrab -cvsRoot :ext:email@example.com:/cvsroot/cvsgrab -rootUrl http://cvs.sourceforge.net/viewcvs.py/ -packagePath cvsgrab/cvsgrab -destDir c:/tmp -packageDir cvsgrab
You have fixed the bugs, and changed lots of source files. To submit your changes back to project X, where you have write access, you connect your notebook to an internet connection with no blocking firewall, then you use your preferred cvs client (command line, ViewCVS...) and commit your work directly, with no additional setup.
I was searching for a way to download CVS modules from behind a really
strict firewall (and a very unhelpful IT staff). Thanks for making
CVSGrab. It's really useful and needed.
It worked first try for me. The examples are great, everything I need to know.
That's the tool I've been looking for since the beginning of time ;-)
Yes, I 'live' behind a restrictive FireWall and downloading the full nightly CVS tarball of the SF projects I use is not really an option.
Thanks again! Stefan
Author: Ludovic Claude ( email ), freelance developer