How to programatically get the latest commit date on a CVS checkout

CVS files on a branch being at different timestamps, the accuracy of picking any one file to get the last time-info for the branch is hardly worth.

But, it can get better if there is some file which will be changed often. For, example, in one of my bases, there is a version.h file which is updated on every version shift (minor or major). That can be used for time-info on the current version (again not accurate to all the files in the branch, but it does give a bottom line).

So, if you know a file that can give you a bottom line value,

cvs log path/to/version.h -r branch/tag | grep ^date | sort | tail -1

will give you the last timestamp for that file.


If you can enumerate the entire file set of the base like this,

find /base/dir -type f | grep -v CVS > files.txt

then, you can loop the cvs command above for each file,

rm -f allFiles.txt
for f in $(<files.txt); do cvs log $f ...etc... tail -1 >> allFiles.txt
sort allFiles.txt | tail -1

Last line of the sort will give you exact date for the most recent commit.
Alas, you will not get the file name (which can also be done with some more fu)

Tags:

Cvs