News: patch for broken -D switch added, more about it here.
The version of the full source tarball has been changed to 1.11.1p1e1 to avoid confusion with the official 1.11.p1

CVS is a great free version control system, but very few things are so good that they can't be improved ;-) To get the changes between to points in time on the main trunk you can say:

cvs rdiff -D "2001-11-02" -D "2001-11-25" foo/bar
I needed an easy way to get diffs between two points in time on a branch also. With the "official" CVS version this can't be done directly, instead you'd have to do something like this:
cvs co -r mybranch -D "2001-11-02" foo/bar
cvs tag a_dummy_tag foo/bar
cvs co -r mybranch -D "2001-11-25" foo/bar
cvs diff -r a_dummy_tag foo/bar > the_diff_file
cvs tag -d a_dummy_tag foo/bar

This is obviously not the optimal way, since we are not interested in the files themselves, or to do any tagging. We just want the diff. (We are assuming here that foo/bar is a directory, not a single file. If it would be a file it would be possible to use rdiff and the revision numbers directly. But even then you'd have to figure out the revision numbers manually by doing a cvs log and looking at the timestamps.)

So, what next ? Well, a quick search on the net to see if somebody already has run into the same problem and solved it. I didn't find anything so I had to fix it myself :-( Things are, however not as bad as it may seem at first. There is already a code in CVS that can translate a symbolic description using date/time and the name of the branch. It is intended to be used to merge changes after an import and looks like this:

cvs co -j import_branch:"2000-01-03" -j import_branch foo/bar

This means: check out the current main branch, and merge it with the changes that has happened on the branch called "import_branch" since January 3, 2000. This raises some hope that we would be able to get what we are looking for by saying something like this:

cvs rdiff -r mybranch:"2001-11-02" -r mybranch:"2001-11-25" foo/bar

Well, that doesn't work with the official CVS version. Otherwise I wouldn't be writing this :-) The whole 'mybranch:"2001-11-02"' is interpreted as a tag, which of course always fails since it contains characters that aren't allowed in tags. The patch further down on this page fixes this. Note that it is a quick hack that fixes cvs rdiff (also known as cvs patch) only, all other commands that previously didn't support this syntax still don't. This works for me (tm) but has not been extensively tested. Use at your own risk! To use it, get the official cvs version 1.11.1p1 source code, put my patch file in the src directory, cd there and say:

patch < cvs_1.11.1p1_patch

After that just (re)compile & install following the original instructions. Or, you can take my pre-patched source tarball if you prefer. (you need bzip2 to open it)

Rdiff patch for cvs 1.11.1p1
Patch that fixes broken -D switch for cvs 1.11.1p1
Full source with both patches already applied
MD5 sums
The official CVS home page

So, why is this not in the official distribution ? Well, perhaps the current developers fear it will break something. (which is a valid point since CVS has been around for quite some time now and is considered quite stable) I don't know for sure because so far they have been unwilling to talk to me. Let's hope some functionality similar to this will be included in the official distribution sometime in the future. It would make an already great product even better.

Staffan Öhman