A developer's CVS working directory often contains locally modified
copies of checked-in versions of files. While the cvs diff command
compares checked-in and local versions conveniently, there's no easy way
to the checked-in version itself.
CVSUtil tries to bridge this gap by providing
an easy-to-use programming interface to figure
out which version of a file has been checked into CVS last and,
upon request, opens this revision and provides a reading
file handle to it.
It uses cvs' local CVS/Root and CVS/Repository directories to
find out about the CVSROOT of the current project and the relative
location of the current subdirectory within the project.
If your system doesn't have the cvs command in your $PATH variable
(i.e. if you can't type cvs in your shell to call it), you need to tell
CVSUtil first, where it's located, before you start using any of the
commands listed below. The function returns the new setting of the
path to the cvs command. If called without parameters, it returns the
Opens revision $rev of $filename and returns a read-only file handle
to it. Note that you need to chdir() into a CVS working directory containing
the file $filename, first. If $rev is not specified,
open_revision() will use get_latest_revision() to determine
the most recently checked-in version and provide a file handle to it.
Figures out the revision number of the most recently checked-in version
of the file $filename. Note that you need to chdir() into a CVS working
directory containing the file $filename, first. Returns the revision
number as a string (e.g. "1.12") and undef in case of an error.
Determines the relative path to $filename, starting from the CVS's
root directory. Note that you need to chdir() into a CVS working
directory containing the file $filename, first.
E.g., if you're in projectname/dir1/dir2 and you call
get_cvs_path("test.c"), you'll get "projectname/dir1/dir2/test.c"
back, even if your local working directory is not projectname/dir1/dir2
but something like myproject-1.1/dir1/dir2.