VCS::LibCVS::FileBranch - A specific branch of a file managed by CVS.
Represents a single branch of a file managed by CVS.
Branches are identified by revision numbers, but most have branch tags in addition.
$file_branch = VCS::LibCVS::FileBranch->new($file, $tag_spec, $revision)
$file = $file_branch->get_revision_number()
$file = $file_branch->get_file()
$tag = $file_branch->get_tag()
$file_rev = $file_branch->get_tip_revision()
Return the latest revision (the tip) of the branch.
$file_rev = $file_branch->get_first_revision()
Return the first revision of the branch. For the trunk, this is 1.1 or equivalent. For a branch it's the revision on the parent branch that it sprouts from. The revision knows that it belongs on this branch, so calling successor() on it will return the next revision on this branch.
XXXBUG: This doesn't handle the cases where the first revision on the trunk or the base of the branch is gone.
$file_rev = $file_branch->get_revision($time)
Seconds since the epoch.
Return the revision of the branch at the given time. If the branch was not created at the time, undef is returned. If the time is in the future an exception is thrown (predictions of the future are not yet supported).
$branch = $file_branch->get_branch()
Return the repository wide branch that this is part of.
if ($file_branch->is_trunk()) { . . .
Return true if this FileBranch is the trunk, false otherwise. A trunk branch has no parent.
$parent_file_branch = $file_branch->get_parent()
Get the FileBranch from which this FileBranch sprouts. Throws an exception if this is the trunk FileBranch.
Of course, due to CVS's lazy branching scheme, FileBranches on the same branch, but for different files, may identify different branches as their parent. See the method precedes() for help handling this case.
if ($file_branch->equals($another_file_branch)) { . . .
Return true if these represent the same FileBranch.
if ($file_branch->precedes($another_file_branch)) { . . .
Because of CVS's lazy branching, two branches may sprout from the same revision on one file, while on another file, one is a subbranch of the other. For example: on file1 brancha is 1.3.2, and branchb is 1.3.4; while on file2 brancha is 1.8.2 and branchb is 1.8.2.6.2. This method can help you handle this case. It returns true if this branch is an ancestor branch or a possible ancestor branch of the given branch, and false otherwise.
VCS::LibCVS
To install VCS::LibCVS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm VCS::LibCVS
CPAN shell
perl -MCPAN -e shell install VCS::LibCVS
For more information on module installation, please visit the detailed CPAN module installation guide.