CVS module

This module subclasses the Files module for CVS repository.

See Files POD for method information.

Methods are sorted in the same order as in the super-class.

toreal ($pathname, $releaseid)

toreal translate the pair $pathname/$releaseid into a real full OS-absolute path.

  1. $pathname

    a string containing the path relative to 'sourceroot'

  2. $releaseid

    the release (or version) in which $pathname is expected to be found

If $pathname is located in some directory to ignore, the result is undef. Otherwise, the result is the full OS path in the correct 'version' directory.

Note:

getdiff ($filename, $release1, $release2)

getdiff returns the "instructions" (additions and erasures) required to transform the file from $release1 to $release2 version.

  1. $filename

    a string containing the filename

  2. $release1

    a string containing the source version

  3. $release2

    a string containing the final version

The set of "instructions" is computed by shell command rcsdiff.

dirempty ($pathname, $releaseid)

dirempty returns 1 (true) if the directory is empty, 0 (false) otherwise.

  1. $pathname

    a string containing the path

  2. $releaseid

    the release (or version) in which $pathname is expected to be found

To determine if $pathname is empty, the files contained therein are checked for a valid revision and directories are recursively explored. A valid revision is sufficient to decide non-empty directory.

If the algorithm reaches the end of content, directory is empty.

Contained subdirectories or files are not excluded by 'ignoredirs' or 'ignorefiles' filters to give a visual feedback of directory existence. These subdirectories or files will be effectively excluded when displaying the directory.

cleanstring ($in)

cleanstring returns its argument with all "dangerous" characters removed.

  1. $in

    String to clean

"Dangerous" characters are those which have special meaning for the shell such as $ (starting substitution), ; (statement separator), …

This is rather brute force since sophisticated escape rules could be designed to leave full freedom to the user. But till now, nobody complained.

allreleases ($filename)

allreleases returns a list of all releases available for the designated file.

  1. $filename

    A string containing the filename

A release is not a numeric revision, it is specific user symbol. It is a tag usually associated with a software release, but may also name a branching point.

Two files with the same release tag are in a consistent state.

For files, the list is extracted from 'symbols' control information. Since CVS does not manage directory version, the release is arbitrarily made of the 'v' URL argument (if it exists) and the default value of variable 'v'.

allrevisions ($filename)

allrevisions returns a list of all revisions available for the designated file.

  1. $filename

    A string containing the filename

A revision is a dot-separated set of numbers. It is automatically generated by CVS at commit time.

Revision numbers between files are not correlated.

For files, the list is extracted from 'branch' control information. It is empty for directories.

byrevision ($a, $b)

byrevision is an auxiliary compare function for sort.

  1. $a

  2. $b

    Strings to compare (CVS revision numbers)

This is an "ordinary" function, not a method (no $self first argument).

parsecvs ($filename)

parsecvs builds a hash %cvs which summarises control information contained in the CVS difference file $filename.

  1. $filename

    A string containing the filename

Caveat:

parsecvs parses a CVS difference file (a bit like rlog does when listing content, but much less thoroughly). It stops when it reaches the text. Ideally, an rcs tool would be better.

It is critical for good operation of CVS class.