diff options
author | Fabien Tassin <fta@sofaraway.org> | 2008-06-06 15:53:39 +0200 |
---|---|---|
committer | Fabien Tassin <fta@sofaraway.org> | 2008-06-06 15:53:39 +0200 |
commit | ed677e453e93d607a31366eb12816cf8e55daaf5 (patch) | |
tree | f9afb32a567f4794b8d8e37c5a83bdafcdae9ec8 /src/mozclient | |
parent | 705330e592cd154dddf882c8ab6699f2be8aa087 (diff) |
* [mozclient] add support for svn
- add src/mozclient/lib/MozClient/Subversion.pm
- update src/mozclient.pl
Diffstat (limited to 'src/mozclient')
-rw-r--r-- | src/mozclient/lib/MozClient/Subversion.pm | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/src/mozclient/lib/MozClient/Subversion.pm b/src/mozclient/lib/MozClient/Subversion.pm new file mode 100644 index 0000000..96ea1f9 --- /dev/null +++ b/src/mozclient/lib/MozClient/Subversion.pm @@ -0,0 +1,86 @@ +# -*- mode: Perl -*- + +# Copyright (c) 2007-2008 Fabien Tassin <fta@sofaraway.org> +# Description: MozClient::Subversion +# +# 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, 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., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +############################################################################ + +package MozClient::Subversion; + +use vars qw(@ISA); +use strict; +use MozClient::VCS; + +@ISA = ("MozClient::VCS"); + +sub get_client { + my $self = shift; + + $self->LOG("MozClient::Subversion::get_client()"); + # nothing to do +} + +sub convert_revdate { + my $self = shift; + my $arg = shift; + + $self->LOG("MozClient::Subversion::convert_revdate($arg)"); + $arg =~ s,.*r(\d+),$1,; + $arg; +} + +sub set_revdate { + my $self = shift; + + $self->LOG("MozClient::Subversion::set_revdate()"); + + # We can set a revision for svn + $self->{'mozclient_date'} = + '-r ' . $self->convert_revdate($self->{'have_date'}); +} + +sub checkout { + my $self = shift; + + $self->LOG("MozClient:Subversion::checkout:()"); + $self->chdir($self->work_dir); + my $modules = []; + $self->{'MOZCLIENT_VCS_LOC'} .= "/" unless $self->{'MOZCLIENT_VCS_LOC'} =~ m,/$,; + if (defined $self->{'MOZCLIENT_PROJECT'}) { + push @$modules, + $self->{'MOZCLIENT_VCS_LOC'} . $self->{'MOZCLIENT_PROJECT'} . "/"; + } + else { + for my $module (@{$self->{'MOZCLIENT_MODULES'}}) { + push @$modules, (sprintf " %s%s/%s", $self->{'MOZCLIENT_VCS_LOC'}, + $self->{'MOZCLIENT_PROJECT'}, $module); + } + } + my $cmd = sprintf "svn checkout %s %s mozilla", $self->{'mozclient_date'}, + join " ", @$modules; + $self->run_system($cmd); + $self->chdir(".."); +} + +sub tar_exclude { + my $self = shift; + + $self->LOG("MozClient::Subversion::tar_exclude()"); + [ '--exclude .svn' ]; +} + +1; |