NAME
VCS::LibCVS::FileBranch - A specific branch of a file managed by CVS.
SYNOPSIS
DESCRIPTION
Represents a single branch of a file managed by CVS.
Branches are identified by revision numbers, but most have branch tags in addition.
CLASS ROUTINES
new()
$file_branch = VCS::LibCVS::FileBranch->new($file, $tag_spec, $revision)
- return type: VCS::LibCVS::FileBranch
- argument 1 type: VCS::LibCVS::RepositoryFile
- argument 2 type: VCS::LibCVS::Datum::TagSpec
- argument 3 type: VCS::LibCVS::Datum::RevisionNumber
INSTANCE ROUTINES
get_revision_number()
$file = $file_branch->get_revision_number()
get_file()
$file = $file_branch->get_file()
get_tag()
$tag = $file_branch->get_tag()
get_tip_revision()
$file_rev = $file_branch->get_tip_revision()
Return the latest revision (the tip) of the branch.
get_first_revision()
$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.
get_revision($time)
$file_rev = $file_branch->get_revision($time)
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).
get_branch()
$branch = $file_branch->get_branch()
Return the repository wide branch that this is part of.
is_trunk()
if ($file_branch->is_trunk()) { . . .
Return true if this FileBranch is the trunk, false otherwise. A trunk branch has no parent.
get_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.
equals()
if ($file_branch->equals($another_file_branch)) { . . .
Return true if these represent the same FileBranch.
precedes()
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.
SEE ALSO
VCS::LibCVS