App-Slaughter
view release on metacpan or search on metacpan
lib/Slaughter/Transport/revisionControl.pm view on Meta::CPAN
=head1 NAME
Slaughter::Transport::revisionControl - Transport base-class.
=head1 SYNOPSIS
This is a base-class for a generic revision control based transport.
=cut
=head1 DESCRIPTION
This module implements the primitives which our transport API demands, but
it does so in an abstract fashion with the intention that sub-classes
will provide the missing configuration to allow it to be used.
This module may be used by any revision-control system, or other tool,
that allows a fetch of a remote repository to be carried out by a simple
command such as:
=for example begin
$cmd repository-location destination-path
=for example end
In our derived Mercurical class we set the command to "C<hg clone>", similarly
in the GIT class we use "C<git clone>". Finally although it isn't a revision
control system our rsync implementation works via a subclass precisely
because it is possible to fetch a remote tree using a simple command,
in that case it is:
=for example begin
rsync -qazr repository-location destination-path
=for example end
B<NOTE>: A full checkout of the remote repository is always inititated by
this module.
It is possible that a future extension to this module will allow an existing
repository to be uploaded in-place.
=cut
=head1 SUBCLASSING
If you wish to write your own transport for a revision control tool,
or similar command that will fetch a remote repository, you must
subclass this class and implement the C<_init> method.
The following parameters should be populated in your derived class:
=over 8
=item C<cmd_clone>
The command to clone the repository. This will have the repository location, as specified by "C<--prefix>", and the destination directory appended to it.
The command will have with the strings "C<#SRC#>" and "C<#DST#>" replaced with the source of the fetch and the destination into which to fetch it repectively.
The following, taken from C<Slaughter::Transport::hg>, demonstrates this:
=for example begin
$self->{ 'cmd_clone' } = "hg clone #SRC# #DST#";
=for example end
=item C<cmd_update>
A command to call to update an I<existing> repository. Currently each time slaughter runs it will pull the remote repository from scratch to a brand new temporary directory, it is possible in the future we will work with a local directory that persi...
=item C<cmd_version>
A command to call which will output the version of the revision control system. This may be any command which outputs text, as the output is discarded. The purposes is to ensure that the binary required for cloning is present on the system.
=item C<name>
The name of the transport.
=back
For a sample implementation please consult C<Slaughter::Transport::hg>.
=cut
=head1 METHODS
Now follows documentation on the available methods.
=cut
use strict;
use warnings;
package Slaughter::Transport::revisionControl;
( run in 0.935 second using v1.01-cache-2.11-cpan-b16cb0d3907 )