Branch Coverage

blib/lib/Monotone/AutomateStdio.pm
Criterion Covered Total %
branch 0 606 0.0


line true false branch
544 0 0 ref $_[0] eq 'ARRAY' ? :
546 0 0 unless defined $options
556 0 0 if (defined $db_name) { }
611 0 0 unless defined $options
620 0 0 if ($service =~ m[/]) { }
625 0 0 if ($service =~ m[^(?:mtn://)?([^/]+)(?:/.*)?$]) { }
641 0 0 if ($service =~ /^([^:]+):\d+$/) { }
654 0 0 unless defined inet_aton($server)
697 0 0 ref $_[0] eq 'ARRAY' ? :
699 0 0 unless defined $options
708 0 0 unless (defined $ws_path)
917 0 0 if (ref $ref eq 'SCALAR') { }
927 0 0 unless ($self->mtn_command('certs', 0, 1, \@lines, $revision_id))
936 0 0 if ($lines[$i] =~ /$io_stanza_re/)
951 0 0 unless exists $kv_record->{$key}
1097 0 0 if defined $revision_id1
1099 0 0 if defined $revision_id2
1380 0 0 if ($self->supports(9)) { }
1392 0 0 if (ref $ref eq 'SCALAR') { }
1403 0 0 unless ($self->mtn_command($cmd, 1, 1, \@lines, $key_id, $pass_phrase))
1460 0 0 if ($self->supports(10)) { }
1471 0 0 if defined $revision_id
1477 0 0 if (ref $ref eq 'SCALAR') { }
1492 0 0 unless ($self->mtn_command_with_options($cmd, 1, 1, \@lines, \@opts, $file_name))
1506 0 0 if ($lines[$i] =~ /$io_stanza_re/)
1520 0 0 if (exists $kv_record->{'attr'})
1524 0 0 unless exists $kv_record->{'state'}
1562 0 0 unless ($self->mtn_command('get_base_revision_id', 0, 0, \@list))
1602 0 0 unless ($self->mtn_command('get_content_changed', 1, 0, \@lines, $revision_id, $file_name))
1616 0 0 if ($lines[$i] =~ /^ *content_mark \[([0-9a-f]+)\]$/)
1659 0 0 unless ($self->mtn_command('get_corresponding_path', 1, 1, \@lines, $source_revision_id, $file_name, $target_revision_id))
1674 0 0 if ($lines[$i] =~ /^ *file \"/)
1721 0 0 if (ref $ref eq 'SCALAR') { }
1735 0 0 unless ($self->mtn_command_with_options('get_current_revision', 1, 1, \@lines, \@opts, @paths))
1776 0 0 unless ($self->mtn_command('get_current_revision_id', 0, 0, \@list))
1812 0 0 if (ref $ref eq 'SCALAR') { }
1822 0 0 unless ($self->mtn_command('get_db_variables', 1, 1, \@lines, $domain))
1831 0 0 if ($lines[$i] =~ /$io_stanza_re/)
1846 0 0 unless (exists $kv_record->{'domain'} and exists $kv_record->{'entry'})
1893 0 0 if (ref $ref eq 'SCALAR') { }
1907 0 0 unless ($self->mtn_command('get_extended_manifest_of', 0, 1, \@lines, $revision_id))
1920 0 0 if ($lines[$i] =~ /$io_stanza_re/)
1934 0 0 unless (exists $kv_record->{'dir'} or exists $kv_record->{'file'})
1943 0 0 if (exists $kv_record->{'file'}) { }
0 0 elsif (exists $kv_record->{'dir'}) { }
1958 0 0 if (exists $kv_record->{'attr'})
1969 0 0 if (exists $kv_record->{'attr_mark'})
1979 0 0 if (exists $kv_record->{'content'})
2051 0 0 if defined $revision_id
2089 0 0 unless ($self->mtn_command('get_file_size', 0, 0, \@list, $file_id))
2124 0 0 if (ref $ref eq 'SCALAR') { }
2134 0 0 unless ($self->mtn_command('get_manifest_of', 0, 1, \@lines, $revision_id))
2147 0 0 if ($lines[$i] =~ /$io_stanza_re/)
2162 0 0 if (exists $kv_record->{'file'} or exists $kv_record->{'dir'})
2169 0 0 if (exists $kv_record->{'file'}) { }
0 0 elsif (exists $kv_record->{'dir'}) { }
2175 0 0 unless exists $kv_record->{'content'}
2184 0 0 if (exists $kv_record->{'attr'})
2192 0 0 if ($type eq 'file') { }
2237 0 0 unless ($self->mtn_command('get_option', 1, 1, $buffer, $option_name))
2299 0 0 if (ref $ref eq 'SCALAR') { }
2308 0 0 unless ($self->mtn_command('get_revision', 0, 1, \@lines, $revision_id))
2341 0 0 unless ($self->mtn_command('get_workspace_root', 0, 1, $buffer))
2374 0 0 if (ref $ref eq 'SCALAR') { }
2385 0 0 unless ($self->mtn_command('graph', 0, 0, \@lines))
2455 0 0 unless ($self->mtn_command('identify', 1, 0, \@list, $file_name))
2488 0 0 unless ($self->mtn_command('interface_version', 0, 0, \@list))
2534 0 0 if (ref $ref eq 'SCALAR') { }
2548 0 0 unless ($self->mtn_command_with_options('inventory', 1, 1, \@lines, \@opts, @paths))
2561 0 0 if ($self->supports(20)) { }
2570 0 0 if ($lines[$i] =~ /$io_stanza_re/)
2595 0 0 if ($lines[$i] =~ /^([A-Z ]{3}) (\d+) (\d+) (.+)$/)
2635 0 0 if (ref $ref eq 'SCALAR') { }
2646 0 0 unless ($self->mtn_command('keys', 0, 1, \@lines))
2654 0 0 if $self->supports(18)
2656 0 0 if ($self->supports(1)) { }
2670 0 0 if ($lines[$i] =~ /$io_stanza_re/)
2685 0 0 unless exists $kv_record->{$key}
2969 0 0 if (defined $base_file_id) { }
2971 0 0 unless ($self->mtn_command('put_file', 0, 0, \@list, $base_file_id, $contents))
2983 0 0 unless ($self->mtn_command('put_file', 0, 0, \@list, $contents))
3044 0 0 unless ($self->mtn_command('put_revision', 1, 0, \@list, $contents))
3192 0 0 if ($self->supports(36)) { }
3238 0 0 if (scalar @_ == 4) { }
0 0 elsif (scalar @_ < 2 or scalar @_ > 5) { }
3260 0 0 if defined $branch
3265 0 0 if (ref $ref eq 'SCALAR') { }
3281 0 0 unless ($self->mtn_command_with_options('show_conflicts', 1, 1, \@lines, \@opts, $left_revision_id, $right_revision_id))
3296 0 0 if ($lines[$i] =~ /$io_stanza_re/)
3310 0 0 if (exists $kv_record->{'left'})
3316 0 0 unless exists $kv_record->{$key}
3361 0 0 if $cmd =~ /^.+\:\:([^:]+)$/
3370 0 0 if (ref $ref eq 'SCALAR') { }
3385 0 0 unless ($self->mtn_command_with_options($cmd, 1, 1, \@lines, \@opts, $uri))
3399 0 0 if ($lines[$i] =~ /$io_stanza_re/)
3449 0 0 if (ref $ref eq 'SCALAR') { }
3459 0 0 unless ($self->mtn_command('tags', 1, 1, \@lines, $branch_pattern))
3468 0 0 if ($lines[$i] =~ /$io_stanza_re/)
3479 0 0 if (exists $kv_record->{'tag'})
3485 0 0 unless exists $kv_record->{$key}
3489 0 0 unless exists $kv_record->{'branches'} and defined $kv_record->{'branches'}
3586 0 0 if ($this->{'mtn_pid'} != 0)
3617 0 0 if $@ eq 'Monotone::AutomateStdio::waitpid-interrupt' and $wait_status < 0 and $! == 4
3624 0 0 if ($wait_status == $this->{'mtn_pid'}) { }
0 0 elsif ($i < 3 and $wait_status == 0) { }
0 0 elsif ($wait_status < 0 and $! == 10) { }
0 0 elsif ($wait_status < 0) { }
3634 0 0 if ($i == 0) { }
0 0 elsif ($i == 1) { }
3727 0 0 if (defined $this->{'db_name'} and $this->{'db_name'} eq ':memory:') { }
3878 0 0 if ($this->{'honour_suspend_certs'} and $ignore) { }
0 0 elsif (not $this->{'honour_suspend_certs'} || $ignore) { }
3880 0 0 if ($self->supports(19)) { }
3936 0 0 if ($_[0]->isa('Monotone::AutomateStdio'))
3938 0 0 if (ref $_[0] ne '') { }
3950 0 0 if (defined $self) { }
3952 0 0 if (defined $handler) { }
3965 0 0 if (defined $handler) { }
4007 0 0 if $_[0]->isa('Monotone::AutomateStdio')
4010 0 0 if ($severity == 1) { }
0 0 elsif ($severity == 2) { }
0 0 elsif ($severity == 3) { }
4012 0 0 if (defined $handler) { }
4026 0 0 if (defined $handler) { }
4040 0 0 if (defined $handler) { }
4096 0 0 if ($_[0]->isa('Monotone::AutomateStdio'))
4098 0 0 if (ref $_[0] ne '') { }
4110 0 0 if (defined $timeout) { }
4112 0 0 if (not $timeout =~ /^\d*\.{0,1}\d+$/ or $timeout < 0 or $timeout > 20)
4116 0 0 if defined $this
4126 0 0 if (defined $self) { }
4128 0 0 if (defined $handler) { }
4141 0 0 if (defined $handler) { }
4184 0 0 if (defined $handle and not ref($handle) =~ /^IO::[^:]+/ and ref $handle ne 'GLOB' and ref \$handle ne 'GLOB')
4190 0 0 if ($stream == 0) { }
0 0 elsif ($stream == 1) { }
4231 0 0 if ($feature == 4 or $feature == 10 or $feature == 35) { }
0 0 elsif ($feature == 19 or $feature == 20 or $feature == 27) { }
0 0 elsif ($feature == 5 or $feature == 12 or $feature == 13 or $feature == 21 or $feature == 36) { }
0 0 elsif ($feature == 3) { }
0 0 elsif ($feature == 17 or $feature == 22 or $feature == 37) { }
0 0 elsif ($feature == 2 or $feature == 8 or $feature == 25 or $feature == 29) { }
0 0 elsif ($feature == 26 or $feature == 41) { }
0 0 elsif ($feature == 1 or $feature == 43) { }
0 0 elsif ($feature == 18) { }
0 0 elsif ($feature == 30 or $feature == 38 or $feature == 39) { }
0 0 elsif ($feature == 42) { }
0 0 elsif ($feature == 24) { }
0 0 elsif ($feature == 0 or $feature == 6 or $feature == 9 or $feature == 14 or $feature == 15 or $feature == 16 or $feature == 23 or $feature == 28 or $feature == 31 or $feature == 34 or $feature == 40) { }
0 0 elsif ($feature == 7 or $feature == 11 or $feature == 32 or $feature == 33) { }
4238 0 0 if $this->{'mtn_aif_version'} >= 5
4248 0 0 if $this->{'mtn_aif_version'} >= 6
4260 0 0 if $this->{'mtn_aif_version'} >= 7
4268 0 0 if $this->{'mtn_aif_version'} < 7
4278 0 0 if $this->{'mtn_aif_version'} >= 8
4289 0 0 if $this->{'mtn_aif_version'} >= 9
4298 0 0 if $this->{'mtn_aif_version'} >= 10 or int $this->{'mtn_aif_version'} == 9 and $mtn_version == 0.43
4307 0 0 if $this->{'mtn_aif_version'} >= 10
4315 0 0 if $this->{'mtn_aif_version'} >= 11
4325 0 0 if $this->{'mtn_aif_version'} >= 12
4333 0 0 if $this->{'mtn_aif_version'} >= 12.1
4341 0 0 if $this->{'mtn_aif_version'} >= 12.2
4359 0 0 if $this->{'mtn_aif_version'} >= 13
4370 0 0 if $this->{'mtn_aif_version'} >= 13.1
4409 0 0 if ($_[0]->isa('Monotone::AutomateStdio'))
4411 0 0 if (ref $_[0] ne '') { }
4423 0 0 if (defined $self) { }
4425 0 0 $suppress ? :
4429 0 0 $suppress ? :
4461 0 0 if ($_[0]->isa('Monotone::AutomateStdio'))
4463 0 0 if (ref $_[0] ne '') { }
4475 0 0 if (defined $self) { }
4477 0 0 if (not $this->{'ws_constructed'}) { }
4479 0 0 if ($this->{'cd_to_ws_root'} and not $switch) { }
0 0 elsif (not $this->{'cd_to_ws_root'} and $switch) { }
4503 0 0 $switch ? :
4536 0 0 if ($data->[$i] =~ /$io_stanza_re/)
4548 0 0 if (exists $kv_record->{'add_dir'}) { }
0 0 elsif (exists $kv_record->{'add_file'}) { }
0 0 elsif (exists $kv_record->{'clear'}) { }
0 0 elsif (exists $kv_record->{'delete'}) { }
0 0 elsif (exists $kv_record->{'new_manifest'}) { }
0 0 elsif (exists $kv_record->{'old_revision'}) { }
0 0 elsif (exists $kv_record->{'patch'}) { }
0 0 elsif (exists $kv_record->{'rename'}) { }
0 0 elsif (exists $kv_record->{'set'}) { }
4557 0 0 unless exists $kv_record->{'content'}
4566 0 0 unless exists $kv_record->{'attr'}
4590 0 0 unless exists $kv_record->{'from'}
4593 0 0 unless exists $kv_record->{'to'}
4603 0 0 unless exists $kv_record->{'to'}
4612 0 0 unless exists $kv_record->{'attr'}
4615 0 0 unless exists $kv_record->{'value'}
4676 0 0 if (exists $key_type_map->{$key}) { }
4683 0 0 if ($type & 1 and $list->[$i] =~ /^ *[a-z_]+ ([a-z_]+)$/) { }
0 0 elsif ($type & 2 and $list->[$i] =~ /^ *[a-z_]+ \[([0-9a-f]+)\]$/) { }
0 0 elsif ($type & 16 and $list->[$i] =~ /^ *[a-z_]+ \[([0-9a-f]*)\]$/) { }
0 0 elsif ($type & 32 and $list->[$i] =~ /^ *[a-z_]+ \"/) { }
0 0 elsif ($type & 64 and $list->[$i] =~ /^ *[a-z_]+ \"(.*)\" \[([0-9a-f]+)\]$/) { }
0 0 elsif ($type & 128 and $list->[$i] =~ /^ *[a-z_]+ \"([^\"]+)\"$/) { }
0 0 elsif ($type & 256 and $list->[$i] =~ /^ *[a-z_]+ \"([^\"]+)\" (\".*)$/) { }
0 0 elsif ($type & 512 and $list->[$i] =~ /^ *[a-z_]+ \"(.+)\"$/) { }
0 0 elsif ($type & 8 and $list->[$i] =~ /^ *[a-z_]+ ?$/) { }
4741 0 0 if ($type & 4) { }
4743 0 0 if (exists $$record->{$key}) { }
4759 0 0 unless $no_errors
4871 0 0 unless $this->{'convert_to_utf8'}
4875 0 0 if (defined $this->{'db_locked_handler'}) { }
4890 0 0 if (ref $ref eq 'SCALAR') { }
0 0 elsif (ref $ref eq 'ARRAY') { }
4912 0 0 if $this->{'mtn_pid'} == 0
4916 0 0 if (scalar @$options > 0)
4925 0 0 if ($out_as_utf8) { }
4954 0 0 if (defined $param)
4958 0 0 if (ref $param ne '') { }
4960 0 0 if ($out_as_utf8) { }
4972 0 0 if ($out_as_utf8) { }
4999 0 0 if ($@)
5001 0 0 if ($@ =~ /$database_locked_re/) { }
5026 0 0 if ($read_ok and $in_as_utf8) { }
0 0 elsif (not $read_ok) { }
5039 0 0 if ($db_locked_exception or $this->{'error_msg'} =~ /$database_locked_re/)
5049 0 0 if ($retry) { }
5066 0 0 if ref $ref eq 'ARRAY'
5079 0 0 unless ($this->{'mtn_err'}->sysread($dummy, 1024))
5129 0 0 if (defined $this->{'io_wait_handler'}) { }
5162 0 0 if ($chunk_start)
5173 0 0 if ($char eq ':') { }
0 0 elsif ($colons == 2) { }
0 0 elsif ($char =~ /\D$/) { }
5179 0 0 if ($char ne 'm' and $char ne 'l')
5194 0 0 if ($header =~ /^(\d+):(\d+):([lm]):(\d+):$/) { }
5197 0 0 if ($cmd_nr != $this->{'cmd_cnt'})
5201 0 0 if ($err_code != 0)
5218 0 0 if ($size > 0)
5220 0 0 if (not defined($bytes_read = $this->{'mtn_out'}->sysread($$buffer, $size, $offset))) { }
0 0 elsif ($bytes_read == 0) { }
5233 0 0 if ($size == 0 and $last eq 'm')
5245 0 0 if ($err_occurred)
5315 0 0 if ($key eq 'm') { }
5328 0 0 if (defined $this->{'io_wait_handler'}) { }
5361 0 0 if ($chunk_start)
5372 0 0 if ($char eq ':') { }
0 0 elsif ($colons == 1) { }
0 0 elsif ($char =~ /\D$/) { }
5378 0 0 unless ($char =~ /^[elmptw]$/)
5393 0 0 if ($header =~ /^(\d+):([elmptw]):(\d+):$/) { }
5396 0 0 if ($cmd_nr != $this->{'cmd_cnt'})
5418 0 0 if ($stream ne 'l') { }
0 0 elsif ($size == 1) { }
5423 0 0 if ($size > 0)
5428 0 0 if (not defined($bytes_read = $this->{'mtn_out'}->sysread($$buffer_ref, $size, $$offset_ref))) { }
0 0 elsif ($bytes_read == 0) { }
5443 0 0 if ($size <= 0)
5450 0 0 if ($stream =~ /^[pt]$/ and defined $details{$stream}{'handle'})
5456 0 0 unless ($details{$stream}{'handle'}->print($header . $$buffer_ref))
5479 0 0 unless ($this->{'mtn_out'}->sysread($err_code, 1))
5484 0 0 if ($err_code != 0)
5495 0 0 if ($details{$ostream}{'used'})
5497 0 0 unless ($details{$ostream}{'handle'}->print($last_msg))
5517 0 0 if (${$details{'e'}{'buffer_ref'};} ne '') { }
0 0 elsif (${$details{'w'}{'buffer_ref'};} ne '') { }
5528 0 0 if ($err_occurred)
5557 0 0 if ($this->{'mtn_pid'} == 0)
5596 0 0 if defined $this->{'db_name'} and not defined $this->{'network_service'}
5602 0 0 if defined $this->{'db_name'}
5603 0 0 if defined $this->{'network_service'}
5605 0 0 unless $this->{'honour_suspend_certs'}
5607 0 0 if (defined $this->{'network_service'}) { }
5627 0 0 if (defined $this->{'db_name'} or defined $this->{'network_service'}) { }
0 0 elsif ($this->{'cd_to_ws_root'} and defined $this->{'ws_path'}) { }
5629 0 0 unless chdir 'File::Spec'->rootdir
5634 0 0 unless chdir $this->{'ws_path'}
5647 0 0 if ($exception)
5649 0 0 if ($$ != $my_pid) { }
5679 0 0 unless (defined $mtn_version)
5681 0 0 unless defined($file = 'IO::File'->new('mtn --version |'))
5685 0 0 if ($line =~ /^monotone (\d+\.\d+)(dev)? ./) { }
0 0 elsif ($line =~ /^monotone (\d+\.\d+)([\d.]+)(dev)? ./) { }
5697 0 0 unless defined $mtn_version
5705 0 0 if ($mtn_version > 0.45)
5714 0 0 if (defined $this->{'network_service'})
5726 0 0 if ($poll_result == 0)
5740 0 0 unless ($this->{'mtn_out'}->sysread($char, 1))
5751 0 0 if ($mtn_version > 0.45) { }
5766 0 0 unless ($startup)
5768 0 0 if ($self->interface_version(\$version) and $version =~ /^(\d+\.\d+)$/) { }
5780 0 0 if ($this->{'db_is_locked'}) { }
5798 0 0 if not $startup and defined $header_err
5838 0 0 unless -d $ws_path
5842 0 0 if $path eq 'File::Spec'->rootdir
5851 0 0 unless defined($options_fh = 'IO::File'->new($options_file, 'r'))
5891 0 0 unless -f $db_name
5892 0 0 unless defined($db = 'IO::File'->new($db_name, 'r'))
5894 0 0 unless binmode $db
5898 0 0 if $db->sysread($buffer, 15) != 15 or $buffer ne 'SQLite format 3'
5903 0 0 if not $db->sysseek(60, 0) or $db->sysread($buffer, 4) != 4 or $buffer ne '_MTN'
5937 0 0 if (not exists $valid_mtn_options{$options->[$i]}) { }
6011 0 0 if ++$counter == 2147483647
6052 0 0 if (defined $options)
6056 0 0 if (exists $non_arg_options{$options->[$i]}) { }
6104 0 0 unless ($$buffer =~ /$closing_quote_re/)
6135 0 0 unless defined $data