File Coverage

blib/lib/Cvs/Command/Checkout.pm
Criterion Covered Total %
statement 29 29 100.0
branch 6 12 50.0
condition n/a
subroutine 5 5 100.0
pod 0 1 0.0
total 40 47 85.1


line stmt bran cond sub pod time code
1             package Cvs::Command::Checkout;
2              
3 2     2   18 use strict;
  2         4  
  2         153  
4 2     2   1705 use Cvs::Result::Checkout;
  2         5  
  2         38  
5 2     2   85 use Cvs::Cvsroot;
  2         3  
  2         29  
6 2     2   70 use base qw(Cvs::Command::Base);
  2         3  
  2         1625  
7              
8             sub init
9             {
10 2     2 0 4 my($self, $module, $param) = @_;
11 2 50       14 $self->SUPER::init(@_) or return;
12              
13 2         12 $self->default_params
14             (
15             cvsroot => undef,
16             revision => undef,
17             date => undef,
18             reset => 0,
19             );
20 2         11 $self->param($param);
21              
22 2 50       9 return $self->error('Mandatory option: module')
23             unless(defined $module);
24              
25 2         12 $self->command('checkout');
26 2 50       42 $self->push_arg('-d', $self->workdir())
27             if defined $self->workdir();
28 2 50       7 $self->push_arg('-A')
29             if $self->param->{reset};
30 2 50       5 $self->push_arg('-r', $self->param->{revision})
31             if defined $self->param->{revision};
32 2 50       5 $self->push_arg('-D', $self->param->{date})
33             if defined $self->param->{date};
34 2         6 $self->push_arg($module);
35 2         7 $self->go_into_workdir(0);
36              
37 2         30 my $result = new Cvs::Result::Checkout;
38 2         14 $self->result($result);
39              
40 2         26 my $main = $self->new_context();
41 2         10 $self->initial_context($main);
42              
43 2         23 return $self;
44             }
45              
46             1;
47             =pod
48              
49             =head1 LICENCE
50              
51             This library is free software; you can redistribute it and/or modify
52             it under the terms of the GNU Lesser General Public License as
53             published by the Free Software Foundation; either version 2.1 of the
54             License, or (at your option) any later version.
55              
56             This library is distributed in the hope that it will be useful, but
57             WITHOUT ANY WARRANTY; without even the implied warranty of
58             MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
59             Lesser General Public License for more details.
60              
61             You should have received a copy of the GNU Lesser General Public
62             License along with this library; if not, write to the Free Software
63             Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
64             USA
65              
66             =head1 COPYRIGHT
67              
68             Copyright (C) 2003 - Olivier Poitrey
69