
VCS::LibCVS::WorkingFile - A file checked out of CVS.


This object represents a local copy of a file checked out from CVS.

VCS::LibCVS::WorkingFileOrDirectory

$working_file = VCS::LibCVS::WorkingFile->new($filename)
The name of the file which is under CVS control.
Creates a new WorkingFile. The filename may be relative or absolute, and is stored as such.
It throws an exception if the file is not recorded in the CVS/Entries file.

$r_file = $w_file->get_remote_object()
Returns the remote CVS file associated with this working file.
It reads the CVS sandbox administrative directory to get this info.
$branch = $w_file->get_branch()
Returns the branch this local file is on.
If there is no sticky branch tag, it returns the MAIN branch.
$file_branch = $w_file->get_file_branch()
Returns the file branch this local file is on.
The branch is determined by looking at any sticky branch tags, and then at the revision number.
If a branch has a sticky non-branch tag, then there can be amibiguity about which branch the revision is on. For instance, revision 1.4 could be the fourth revision on branch 1 (the trunk), or it could be the initial revision of branch 1.4.2. The best way to resolve this ambiguity would be to examine the rest of the files in the repository to determine which branch the non-branch tag lies on. Such an algorithm is not implemented here, instead the parent branch is always assumed. This is important to consider in the common case of base tags for branches.
$w_file->get_directory_of()
Returns the working directory containing this object. If the directory isn't under CVS control, or if the object's specification is relative, and it's parent directory can't be determined, an exception is thrown.
$w_file->get_scheduled_action()
Returns any action which has been scheduled on this file. The actions are:
ACTION_NONE ACTION_ADD ACTION_REMOVE
$w_file->get_state()
Returns the state of the local file. This is determined with reference to the information in the Admin directory, including any scheduled actions. The possible states are:
STATE_UPTODATE STATE_MODIFIED STATE_HADCONFLICTS STATE_ABSENT
In the case of a file which has been scheduled for removal, it should not appear in the working directory, so being absent is treated as uptodate. If it is present, it is reported as modified.
$w_file->get_rstate()
Returns the state of the repository with respect to the working file info. This is determined with reference to the information in the Admin directory, including any scheduled actions. The possible states are:
STATE_UPTODATE STATE_MODIFIED STATE_ABSENT STATE_WILLCONFLICT
$w_file->get_revision_number()
Return the revision number of the local file.
When a file was imported and then checked out on the trunk, it will have a revision number of 1.1.1.1, and no sticky tag, and actually reside on the trunk. This routine will hack that case to retun the revision 1.1.

VCS::LibCVS