NAME

VCI::Abstract::Repository - A repository where version-controlled items are kept.

SYNOPSIS

 my $repo = VCI->connect(...); # See VCI.pm for details.

 my $projects = $repo->projects;
 my $project = $repo->get_project(name => 'Foo');

DESCRIPTION

As mentioned in VCI, a Repository is a "server" where files are stored by your version-control system.

In some VCSes, it's not really a "server", it's just a directory that contains Projects.

For details on what your VCS considers a "repository", see the VCI::VCS driver for your VCS.

METHODS

Accessors

All these accessors are read-only.

root

The same as "repo" in VCI.

projects

An arrayref of every VCI::Abstract::Project in this repository. In some VCSes, this may just be the projects in the root directory of the repository, or something that doesn't entirely describe everything that's tracked in the system.

root_project

In some VCSes, the whole Repository can be viewed as one big Project. If that works for your VCS, then this returns a VCI::Abstract::Project that represents the "root directory" of the Repository.

If your VCS does not support this, root_project returns undef. That means that all users of root_project must check if it returns undef.

Generally, "directory based" VCSes like CVS and Subversion support root_project, and other VCSes don't.

The "LIMITATIONS AND EXTENSIONS" section of your driver's documentation will say if it supports this method. By default, drivers don't support it, so if the driver's documentation doesn't say anything about it, then you can assume it will return undef on that version-control system.

vci

The VCI that connected us to this repository. In general, unless you're a VCI implementor, you probably don't care about this.

Getting a Project

get_project
Description

Gets a single VCI::Abstract::Project from the repository, by name.

Parameters

Takes the following named parameters:

name

The unique name of this Project. Something that uniquely identifies this project in the version control system. Usually, this is just the name of the directory that contains the Project, from the root of the repository.

(For example, mozilla/webtools/bugzilla is the "name" of the Bugzilla project inside of the Mozilla CVS Server.)

Returns

The VCI::Abstract::Project that you asked for. Most VCI::VCS implementations will return a valid Project object even if that object doesn't exist in the Repository. The only way to know if a Project is valid is to perform some operation on it.

Some VCI::VCS implementations may die if you request an invalid Project.

CLASS METHODS

Constructors

Usually you won't construct an instance of this class directly, but instead, use "connect" in VCI to get a Repository object.

new

Takes all "Accessors" of this class as named parameters. The following fields are required: "root" and "vci".