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.
$pathname
a string containing the path relative to 'sourceroot'
$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:
This function should not be used outside this module.
getdiff ($filename, $release1, $release2)
getdiff
returns the "instructions" (additions and erasures) required to transform the file from $release1
to $release2
version.
$filename
a string containing the filename
$release1
a string containing the source version
$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.
$pathname
a string containing the path
$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.
$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.
$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.
$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
.
$a
$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
.
$filename
A string containing the filename
Caveat:
This method is indirectly recursive through toreal
. Special precaution must be taken against infinite recursion.
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.