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); # Checkout / update the location '$src_path' # into local directory '$dst_path' my ($changed, $changes) = $rep->export($runtime, $src_path, $dst_path); # If the repository impl supports it, get the more # recent repository global changelist number my $changelist = $rep->changelist($runtime);
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
Optionally, it can also extract & return the details of all changelists committed since the previous checkout operation.
The valid configuration options for the repositories block are
repositories
This method creates a new repository. The name argument is an alphanumeric token representing the name of the repository. The label argument is a human friendly name of the repository. The optional options argument is a hashref of implementation specific options. The optional env argument is a hashref of environment variables to set when running the commands to access the repository.
name
label
options
env
Returns the changelist to which the repository is synchronized. This is defined to be the most recent changelist, not newer than the timestamp to which the build runtime is set. This method should be implemented by any repository types which support changelists. For those that don't the default implementation will throw an error.
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.
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.
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.
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.
Exports the location $src into the directory $dst. Returns zero if there were no changes to export; non-zero if the module was new or changed. The second return parameter is a hash reference whose keys are change numbers, and values are the corresponding Test::AutoBuild::Change objects. This second parameter is optional, since not all repositories maintain changelists. This is a virtual method which must be implemented by all subclasses.
$src
$dst
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>
perl(1), Test::AutoBuild, Test::AutoBuild::Module, Test::AutoBuild::Repository::CVS, Test::AutoBuild::Repository::GNUArch, Test::AutoBuild::Repository::Perforce, Test::AutoBuild::Repository::Mercurial, Test::AutoBuild::Repository::Subversion, Test::AutoBuild::Repository::Disk, Test::AutoBuild::Repository::SVK
perl(1)
To install Test::AutoBuild, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::AutoBuild
CPAN shell
perl -MCPAN -e shell install Test::AutoBuild
For more information on module installation, please visit the detailed CPAN module installation guide.