VCI/VCS/Cvs/Repository.pm

filter: Statementstmt 42.4% 14 / 33 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 42.8% 3 / 7 Podpod 0.0% 0 / 1 totaltotal 32.0% 17 / 53 CC 4 SCAR 16.9
CC
4
Cov
34%
BUILD
12.0
_build_projects
6.0
_build_root_project
2.0
CRAP 5.4
« VCI/Abstract/Commit.pm ↑ Summary VCI/VCS/Svn/Committable.pm »
1 package VCI::VCS::Cvs::Repository;
2 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use MooseX::Method;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 ▶use Cwd qw(abs_path);
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 extends 'VCI::Abstract::Repository';
8  
9 0 ▶has 'x_is_local' => (is => 'ro', isa => 'Bool', default => sub { 0 });
Subroutine __ANON__: not called CC=1 SCAR=1.2
10 1 has 'x_dir_part' => (is => 'ro', isa => 'Bool');
11  
12 0 ▶sub BUILD {
Subroutine BUILD: not called CC=3 SCAR=24.8
Pod undocumented
13 0 my $self = shift;
14
15 # Make relative local roots into absolute roots.
16 0 my $root = $self->root;
17 # XXX This test will break on Windows (C:, D:, etc.)
18 0 ▶ if ($root =~ /^:local:/ || $root !~ /:/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($root =~ /^:local:/ or not $root =~ /:/) 0 0 0
Condition0%0/3
$root =~ /^:local:/ or not $root =~ /:/
l!l&&r!l&&!r
000
MC/DC0%0/2
$root =~ /^:local:/ or not $root =~ /:/
$root =~ /^:local:/ not $root =~ /:/
Truth table0%0/3
A or not(B)
A= $root =~ /^:local:/B= not $root =~ /:/
ABresult
1X1
011
000
19 0 $root =~ /^(:local:)?(.*)$/;
20 0 my $dir = abs_path($2);
21 0 $self->{root} = ":local:$dir";
22 0 $self->{x_is_local} = 1;
23 # We don't yet need this set for other repos than :local: repos.
24 0 $self->{x_dir_part} = $dir;
25 }
26
27 0 $self->_root_never_ends_with_slash;
28 }
29  
30 0 ▶sub _build_projects {
Subroutine _build_projects: not called CC=2 SCAR=17.9
31 0 my $self = shift;
32 0 my $root_project = $self->get_project(name => '');
33 0 my $contents = $root_project->root_directory->contents;
34 0 ▶ my @directories = grep { $_->isa('VCI::Abstract::Directory')
Condition0%0/3
$_->isa('VCI::Abstract::Directory') && $_->path->stringify ne 'CVSROOT'
!ll&&!rl&&r
000
MC/DC0%0/2
$_->isa('VCI::Abstract::Directory') && $_->path->stringify ne 'CVSROOT'
$_->isa('VCI::Abstract::Directory') $_->path->stringify ne 'CVSROOT'
Truth table0%0/3
A && B
A= $_->isa('VCI::Abstract::Directory')B= $_->path->stringify ne 'CVSROOT'
ABresult
0X0
100
111
35 && $_->path->stringify ne 'CVSROOT' } @$contents;
36 0 my @projects = map { $self->project_class->new(
37 name => $_->path->stringify, repository => $self) }
38 @directories;
39 0 return \@projects;
40 }
41  
42 0 ▶sub _build_root_project { $_[0]->_root_project; }
Subroutine _build_root_project: not called CC=1 SCAR=6.9
43  
44 # XXX get_project Doesn't support modules yet.
45 # For get_project module support, all paths will be from the root of the
46 # repository. But for directory support, they will be from the root
47 # of the directory. Can do "cvs co -c" to get modules.
48  
49 1 __PACKAGE__->meta->make_immutable;
50  
51 1 1;
« VCI/Abstract/Commit.pm ↑ Summary VCI/VCS/Svn/Committable.pm »