
Test::AutoBuild::Repository - Source control repository access

use Test::AutoBuild::Repository
my $rep = Test::AutoBuild::Repository->new(
name => $name,
options => \%options,
env => \%env,
label => $label);
# Add a module to the repository
$rep->module($module);
# Initialize the repository
$rep->init();
# Checkout / update the module
my $changed = $rep->export($name, $module);

This module provides the API for interacting with the source control repositories. A repository implementation has to be able to do two main things
* Get a checkout of a new module * Update an existing checkout, determining if any changes where made

The valid configuration options for the repositories block are

my $rep = Test::AutoBuild::Repository->new(name => $name, label => $label, options => \%options, env => \%env);
This method creates a new repository. The
nameargument is an alphanumeric token representing the name of the repository. Thelabelargument is a human friendly name of the repository. The optionaloptionsargument is a hashref of implementation specific options. The optionalenvargument is a hashref of environment variables to set when running the commands to access the repository.my $name = $rep->name([$name]);
When run without any arguments, returns the alphanumeric token representing the name of the repository. If a single argument is supplied, this is use to update the name.
my $value = $rep->option($name[, $value]);
When run with a single argument, retuns the option value corresponding to the name specified in the first argument. If a second argument is supplied, then the option value is updated.
my $value = $rep->env($name[, $value]);
When run with a single argument, retuns the environment variable corresponding to the name specified in the first argument. If a second argument is supplied, then the environment variable is updated.
my $label = $rep->label([$label]);
When run without any arguments, returns the human friendly string representing the label of the repository. If a single argument is supplied, this is use to update the label.
my $module = $rep->module($name[, $module]);
When run with a single argument, returns the module object corresponding to the name specified as the first argument. If the second argument is supplied, then the module object is updated.
my @modules = $rep->modules();
Returns the list of modules in this repository
$rep->init();
Performs any one time initialization required prior to exporting modules from the repoitory.
my $changed = $rep->export($name, $module);
Exports the module specified in the second argument to a directory specified by the first argument. Returns zero if there were no changes to export; non-zero if the module was new or changed. This is a virtual method which must be implemented by all subclasses.
my $output = $rep->_run($cmd);
Runs the command specified in the first argument, having first setup the environment variables specified when the repository was created. It returns any text written to standard out by the command

Daniel Berrange <dan@berrange.com>

Copyright (C) 2002 Daniel Berrange <dan@berrange.com>
