VCI/VCS/Bzr/Directory.pm

filter: Statementstmt 37.5% 6 / 16 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 1 / 2 Podpod n/a totaltotal 38.8% 7 / 18 CC 1 SCAR 4.1
CC
1
Cov
38%
_build_contents
2.0
BEGIN
1.0
CRAP 1.5
« VCI/Abstract/Repository.pm ↑ Summary VCI/VCS/Bzr/Project.pm »
1 package VCI::VCS::Bzr::Directory;
2 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 1 extends 'VCI::VCS::Bzr::Committable', 'VCI::Abstract::Directory';
5  
6 # XXX Currently always returns HEAD contents.
7 0 ▶sub _build_contents {
Subroutine _build_contents: not called CC=1 SCAR=6.9
8 0 my $self = shift;
9 0 my $root = $self->repository->root . $self->project->name;
10 0 my $path = $root . "/" . $self->path->stringify;
11 # XXX We don't support symlinks yet.
12 0 my $dir_names = $self->vci->x_do(
13 args => ['ls', '--kind=directory', $path]);
14 # Remove trailing slashes from the directory names, as required
15 # by VCI::Type::Path.
16 0 my @dirs = map { $_ =~ s{/$}{}; $_ } split("\n", $dir_names);
17 0 my $file_names = $self->vci->x_do(
18 args => ['ls', '--kind=file', $path]);
19 0 $self->_set_contents_from_list(\@dirs, [split("\n", $file_names)], $root);
20 0 return $self->{contents};
21 }
22  
23 1 __PACKAGE__->meta->make_immutable;
24  
25 1 1;
« VCI/Abstract/Repository.pm ↑ Summary VCI/VCS/Bzr/Project.pm »