Test::AutoBuild::Repository::SVK - A repository for SVK (Distributed Subversion)


Test-AutoBuild documentation Contained in the Test-AutoBuild distribution.

Index


Code Index:

NAME

Top

Test::AutoBuild::Repository::SVK - A repository for SVK (Distributed Subversion)

SYNOPSIS

Top

  use Test::AutoBuild::Repository::SVK




DESCRIPTION

Top

This module provides a repository implementation for the SVK revision control system, a distributed implementation of Subversion. It will automatically import remote repositories it uses into a local repository with a name matching the module name. It has full support for detecting updates to an existing checkout.

CONFIGURATION

Top

Example configuration entry for SVK module looks like

  svk = {
    label = SVK
    module = Test::AutoBuild::Repository::SVK
  }




A module's paths entries either contain the full path of the remote repository in which case it will be imported into a local repository with the same name as the module. If the two arg form is used, the second arg will be used as a subdirectory of the module



 myapp = {
    label = CCM Core
    paths = (
      http://svn.example.org/svn/trunk
      http://svn.example.org/other/trunk -> other
    )
    repository = svk
    group = Software
 }

In this example, the following commands will be run to process the module

   svk import //myapp http://svn.example.org/svn/trunk
   svk sync //myapp

   svk import //myapp/other http://svn.example.org/other/trunk
   svk sync //myapp/other

   svk checkout //myapp myapp
   svk chcekout //myapp/other myapp/other







METHODS

Top

my $repository = Test::AutoBuild::Repository::SVK->new( );

AUTHORS

Top

Daniel Berrange

COPYRIGHT

Top

SEE ALSO

Top

perl(1), Test::AutoBuild::Repository


Test-AutoBuild documentation Contained in the Test-AutoBuild distribution.
# -*- perl -*-
#
# Test::AutoBuild::Repository::SVK by Daniel Berrange
#
# Copyright (C) 2004 Daniel Berrange
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
# $Id: SVK.pm,v 1.10 2007/12/08 21:03:02 danpb Exp $

package Test::AutoBuild::Repository::SVK;

use strict;
use warnings;
use Carp qw(confess);

use base qw(Test::AutoBuild::Repository);


sub new {
    my $proto = shift;
    my $class = ref($proto) || $proto;
    my $self = $class->SUPER::new(@_);

    bless $self, $class;

    return $self;
}


sub export {
    my $self = shift;
    my $runtime = shift;
    my $src = shift;
    my $dst = shift;
    my $logfile = shift;

    my $changed = 0;

    $self->_run(["svk", "mirror", "//$dst", $src], undef, $logfile);
    $self->_run(["svk", "sync", "//$dst"], undef, $logfile);

    if (-d $dst) {
	my $output = $self->_run(["svk", "up", $dst], undef, $logfile);
	if (!($output =~ /^\s*$/)) {
	    $changed = 1;
	}
    } else {
	$self->_run(["svk", "checkout", "//$dst",$dst], undef, $logfile);
	$changed = 1;
    }

    return $changed;
}


1 # So that the require or use succeeds.

__END__