Branch Coverage

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


line true false branch
535 0 0 ref $_[0] eq 'ARRAY' ? :
537 0 0 unless defined $options
547 0 0 if (defined $db_name) { }
602 0 0 unless defined $options
611 0 0 if ($service =~ m[/]) { }
616 0 0 if ($service =~ m[^(?:mtn://)?([^/]+)(?:/.*)?$]) { }
632 0 0 if ($service =~ /^([^:]+):\d+$/) { }
645 0 0 unless defined inet_aton($server)
688 0 0 ref $_[0] eq 'ARRAY' ? :
690 0 0 unless defined $options
699 0 0 unless (defined $ws_path)
908 0 0 if (ref $ref eq 'SCALAR') { }
918 0 0 unless ($self->mtn_command('certs', 0, 1, \@lines, $revision_id))
927 0 0 if ($lines[$i] =~ /$io_stanza_re/)
940 0 0 unless exists $$kv_record{$key}
1088 0 0 if defined $revision_id1
1090 0 0 if defined $revision_id2
1343 0 0 if ($self->supports(8)) { }
1355 0 0 if (ref $ref eq 'SCALAR') { }
1366 0 0 unless ($self->mtn_command($cmd, 1, 1, \@lines, $key_id, $pass_phrase))
1418 0 0 if ($self->supports(9)) { }
1430 0 0 if (ref $ref eq 'SCALAR') { }
1440 0 0 unless ($self->mtn_command($cmd, 1, 1, \@lines, $file_name))
1449 0 0 if ($lines[$i] =~ /$io_stanza_re/)
1463 0 0 if (exists $$kv_record{'attr'})
1465 0 0 unless exists $$kv_record{'state'}
1505 0 0 unless ($self->mtn_command('get_base_revision_id', 0, 0, \@list))
1545 0 0 unless ($self->mtn_command('get_content_changed', 1, 0, \@lines, $revision_id, $file_name))
1559 0 0 if ($lines[$i] =~ /^ *content_mark \[([0-9a-f]+)\]$/)
1602 0 0 unless ($self->mtn_command('get_corresponding_path', 1, 1, \@lines, $source_revision_id, $file_name, $target_revision_id))
1617 0 0 if ($lines[$i] =~ /^ *file \"/)
1664 0 0 if (ref $ref eq 'SCALAR') { }
1678 0 0 unless ($self->mtn_command_with_options('get_current_revision', 1, 1, \@lines, \@opts, @paths))
1719 0 0 unless ($self->mtn_command('get_current_revision_id', 0, 0, \@list))
1755 0 0 if (ref $ref eq 'SCALAR') { }
1765 0 0 unless ($self->mtn_command('get_db_variables', 1, 1, \@lines, $domain))
1774 0 0 if ($lines[$i] =~ /$io_stanza_re/)
1789 0 0 unless (exists $$kv_record{'domain'} and exists $$kv_record{'entry'})
1836 0 0 if (ref $ref eq 'SCALAR') { }
1850 0 0 unless ($self->mtn_command('get_extended_manifest_of', 0, 1, \@lines, $revision_id))
1863 0 0 if ($lines[$i] =~ /$io_stanza_re/)
1877 0 0 unless (exists $$kv_record{'dir'} or exists $$kv_record{'file'})
1886 0 0 if (exists $$kv_record{'file'}) { }
0 0 elsif (exists $$kv_record{'dir'}) { }
1901 0 0 if (exists $$kv_record{'attr'})
1912 0 0 if (exists $$kv_record{'attr_mark'})
1922 0 0 if (exists $$kv_record{'content'})
1994 0 0 if defined $revision_id
2032 0 0 unless ($self->mtn_command('get_file_size', 0, 0, \@list, $file_id))
2067 0 0 if (ref $ref eq 'SCALAR') { }
2077 0 0 unless ($self->mtn_command('get_manifest_of', 0, 1, \@lines, $revision_id))
2090 0 0 if ($lines[$i] =~ /$io_stanza_re/)
2105 0 0 if (exists $$kv_record{'file'} or exists $$kv_record{'dir'})
2112 0 0 if (exists $$kv_record{'file'}) { }
0 0 elsif (exists $$kv_record{'dir'}) { }
2116 0 0 unless exists $$kv_record{'content'}
2127 0 0 if (exists $$kv_record{'attr'})
2135 0 0 if ($type eq 'file') { }
2180 0 0 unless ($self->mtn_command('get_option', 1, 1, $buffer, $option_name))
2242 0 0 if (ref $ref eq 'SCALAR') { }
2251 0 0 unless ($self->mtn_command('get_revision', 0, 1, \@lines, $revision_id))
2284 0 0 unless ($self->mtn_command('get_workspace_root', 0, 1, $buffer))
2317 0 0 if (ref $ref eq 'SCALAR') { }
2328 0 0 unless ($self->mtn_command('graph', 0, 0, \@lines))
2398 0 0 unless ($self->mtn_command('identify', 1, 0, \@list, $file_name))
2431 0 0 unless ($self->mtn_command('interface_version', 0, 0, \@list))
2477 0 0 if (ref $ref eq 'SCALAR') { }
2491 0 0 unless ($self->mtn_command_with_options('inventory', 1, 1, \@lines, \@opts, @paths))
2504 0 0 if ($self->supports(18)) { }
2513 0 0 if ($lines[$i] =~ /$io_stanza_re/)
2538 0 0 if ($lines[$i] =~ /^([A-Z ]{3}) (\d+) (\d+) (.+)$/)
2578 0 0 if (ref $ref eq 'SCALAR') { }
2589 0 0 unless ($self->mtn_command('keys', 0, 1, \@lines))
2597 0 0 if $self->supports(16)
2599 0 0 if ($self->supports(1)) { }
2613 0 0 if ($lines[$i] =~ /$io_stanza_re/)
2626 0 0 unless exists $$kv_record{$key}
2912 0 0 if (defined $base_file_id) { }
2914 0 0 unless ($self->mtn_command('put_file', 0, 0, \@list, $base_file_id, $contents))
2926 0 0 unless ($self->mtn_command('put_file', 0, 0, \@list, $contents))
2987 0 0 unless ($self->mtn_command('put_revision', 1, 0, \@list, $contents))
3135 0 0 if ($self->supports(32)) { }
3181 0 0 if (scalar @_ == 4) { }
0 0 elsif (scalar @_ < 2 or scalar @_ > 5) { }
3203 0 0 if defined $branch
3208 0 0 if (ref $ref eq 'SCALAR') { }
3224 0 0 unless ($self->mtn_command_with_options('show_conflicts', 1, 1, \@lines, \@opts, $left_revision_id, $right_revision_id))
3239 0 0 if ($lines[$i] =~ /$io_stanza_re/)
3253 0 0 if (exists $$kv_record{'left'})
3257 0 0 unless exists $$kv_record{$key}
3304 0 0 if $cmd =~ /^.+\:\:([^:]+)$/
3313 0 0 if (ref $ref eq 'SCALAR') { }
3328 0 0 unless ($self->mtn_command_with_options($cmd, 1, 1, \@lines, \@opts, $uri))
3342 0 0 if ($lines[$i] =~ /$io_stanza_re/)
3392 0 0 if (ref $ref eq 'SCALAR') { }
3402 0 0 unless ($self->mtn_command('tags', 1, 1, \@lines, $branch_pattern))
3411 0 0 if ($lines[$i] =~ /$io_stanza_re/)
3422 0 0 if (exists $$kv_record{'tag'})
3426 0 0 unless exists $$kv_record{$key}
3430 0 0 unless exists $$kv_record{'branches'} and defined $$kv_record{'branches'}
3529 0 0 if ($$this{'mtn_pid'} != 0)
3560 0 0 if $@ eq 'Monotone::AutomateStdio::waitpid-interrupt' and $wait_status < 0 and $! == 4
3567 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) { }
3577 0 0 if ($i == 0) { }
0 0 elsif ($i == 1) { }
3670 0 0 if (defined $$this{'db_name'} and $$this{'db_name'} eq ':memory:') { }
3821 0 0 if ($$this{'honour_suspend_certs'} and $ignore) { }
0 0 elsif (not $$this{'honour_suspend_certs'} || $ignore) { }
3823 0 0 if ($self->supports(17)) { }
3879 0 0 if ($_[0]->isa('Monotone::AutomateStdio'))
3881 0 0 if (ref $_[0] ne '') { }
3893 0 0 if (defined $self) { }
3895 0 0 if (defined $handler) { }
3908 0 0 if (defined $handler) { }
3950 0 0 if $_[0]->isa('Monotone::AutomateStdio')
3953 0 0 if ($severity == 1) { }
0 0 elsif ($severity == 2) { }
0 0 elsif ($severity == 3) { }
3955 0 0 if (defined $handler) { }
3969 0 0 if (defined $handler) { }
3983 0 0 if (defined $handler) { }
4039 0 0 if ($_[0]->isa('Monotone::AutomateStdio'))
4041 0 0 if (ref $_[0] ne '') { }
4053 0 0 if (defined $timeout) { }
4055 0 0 if (not $timeout =~ /^\d*\.{0,1}\d+$/ or $timeout < 0 or $timeout > 20)
4059 0 0 if defined $this
4069 0 0 if (defined $self) { }
4071 0 0 if (defined $handler) { }
4084 0 0 if (defined $handler) { }
4127 0 0 if (defined $handle and not ref($handle) =~ /^IO::[^:]+/ and ref $handle ne 'GLOB' and ref \$handle ne 'GLOB')
4133 0 0 if ($stream == 0) { }
0 0 elsif ($stream == 1) { }
4174 0 0 if ($feature == 4 or $feature == 9 or $feature == 31) { }
0 0 elsif ($feature == 17 or $feature == 18 or $feature == 25) { }
0 0 elsif ($feature == 5 or $feature == 10 or $feature == 11 or $feature == 19 or $feature == 32) { }
0 0 elsif ($feature == 3) { }
0 0 elsif ($feature == 15 or $feature == 20 or $feature == 33) { }
0 0 elsif ($feature == 2 or $feature == 7 or $feature == 23 or $feature == 27) { }
0 0 elsif ($feature == 24 or $feature == 37) { }
0 0 elsif ($feature == 1 or $feature == 39) { }
0 0 elsif ($feature == 16) { }
0 0 elsif ($feature == 28 or $feature == 34 or $feature == 35) { }
0 0 elsif ($feature == 38) { }
0 0 elsif ($feature == 22) { }
0 0 elsif ($feature == 0 or $feature == 6 or $feature == 8 or $feature == 12 or $feature == 13 or $feature == 14 or $feature == 21 or $feature == 26 or $feature == 29 or $feature == 30 or $feature == 36) { }
4181 0 0 if $$this{'mtn_aif_version'} >= 5
4191 0 0 if $$this{'mtn_aif_version'} >= 6
4203 0 0 if $$this{'mtn_aif_version'} >= 7
4211 0 0 if $$this{'mtn_aif_version'} < 7
4221 0 0 if $$this{'mtn_aif_version'} >= 8
4232 0 0 if $$this{'mtn_aif_version'} >= 9
4240 0 0 if $$this{'mtn_aif_version'} >= 10 or int $$this{'mtn_aif_version'} == 9 and $mtn_version == 0.43
4250 0 0 if $$this{'mtn_aif_version'} >= 10
4258 0 0 if $$this{'mtn_aif_version'} >= 11
4268 0 0 if $$this{'mtn_aif_version'} >= 12
4276 0 0 if $$this{'mtn_aif_version'} >= 12.1
4284 0 0 if $$this{'mtn_aif_version'} >= 12.2
4302 0 0 if $$this{'mtn_aif_version'} >= 13
4341 0 0 if ($_[0]->isa('Monotone::AutomateStdio'))
4343 0 0 if (ref $_[0] ne '') { }
4355 0 0 if (defined $self) { }
4357 0 0 $suppress ? :
4361 0 0 $suppress ? :
4393 0 0 if ($_[0]->isa('Monotone::AutomateStdio'))
4395 0 0 if (ref $_[0] ne '') { }
4407 0 0 if (defined $self) { }
4409 0 0 if (not $$this{'ws_constructed'}) { }
4411 0 0 if ($$this{'cd_to_ws_root'} and not $switch) { }
0 0 elsif (not $$this{'cd_to_ws_root'} and $switch) { }
4435 0 0 $switch ? :
4468 0 0 if ($$data[$i] =~ /$io_stanza_re/)
4480 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'}) { }
4487 0 0 unless exists $$kv_record{'content'}
4496 0 0 unless exists $$kv_record{'attr'}
4520 0 0 unless exists $$kv_record{'from'}
4523 0 0 unless exists $$kv_record{'to'}
4533 0 0 unless exists $$kv_record{'to'}
4542 0 0 unless exists $$kv_record{'attr'}
4545 0 0 unless exists $$kv_record{'value'}
4608 0 0 if (exists $$key_type_map{$key}) { }
4615 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_]+ ?$/) { }
4673 0 0 if ($type & 4) { }
4675 0 0 if (exists $$$record{$key}) { }
4691 0 0 unless $no_errors
4803 0 0 unless $$this{'convert_to_utf8'}
4807 0 0 if (defined $$this{'db_locked_handler'}) { }
4822 0 0 if (ref $ref eq 'SCALAR') { }
0 0 elsif (ref $ref eq 'ARRAY') { }
4844 0 0 if $$this{'mtn_pid'} == 0
4848 0 0 if (scalar @$options > 0)
4857 0 0 if ($out_as_utf8) { }
4886 0 0 if (defined $param)
4890 0 0 if (ref $param ne '') { }
4892 0 0 if ($out_as_utf8) { }
4904 0 0 if ($out_as_utf8) { }
4931 0 0 if ($@)
4933 0 0 if ($@ =~ /$database_locked_re/) { }
4958 0 0 if ($read_ok and $in_as_utf8) { }
0 0 elsif (not $read_ok) { }
4971 0 0 if ($db_locked_exception or $$this{'error_msg'} =~ /$database_locked_re/)
4981 0 0 if ($retry) { }
4998 0 0 if ref $ref eq 'ARRAY'
5011 0 0 unless ($$this{'mtn_err'}->sysread($dummy, 1024))
5061 0 0 if (defined $$this{'io_wait_handler'}) { }
5094 0 0 if ($chunk_start)
5105 0 0 if ($char eq ':') { }
0 0 elsif ($colons == 2) { }
0 0 elsif ($char =~ /\D$/) { }
5111 0 0 if ($char ne 'm' and $char ne 'l')
5126 0 0 if ($header =~ /^(\d+):(\d+):([lm]):(\d+):$/) { }
5129 0 0 if ($cmd_nr != $$this{'cmd_cnt'})
5133 0 0 if ($err_code != 0)
5150 0 0 if ($size > 0)
5152 0 0 if (not defined($bytes_read = $$this{'mtn_out'}->sysread($$buffer, $size, $offset))) { }
0 0 elsif ($bytes_read == 0) { }
5165 0 0 if ($size == 0 and $last eq 'm')
5177 0 0 if ($err_occurred)
5247 0 0 if ($key eq 'm') { }
5260 0 0 if (defined $$this{'io_wait_handler'}) { }
5293 0 0 if ($chunk_start)
5304 0 0 if ($char eq ':') { }
0 0 elsif ($colons == 1) { }
0 0 elsif ($char =~ /\D$/) { }
5310 0 0 unless ($char =~ /^[elmptw]$/)
5325 0 0 if ($header =~ /^(\d+):([elmptw]):(\d+):$/) { }
5328 0 0 if ($cmd_nr != $$this{'cmd_cnt'})
5350 0 0 if ($stream ne 'l') { }
0 0 elsif ($size == 1) { }
5355 0 0 if ($size > 0)
5360 0 0 if (not defined($bytes_read = $$this{'mtn_out'}->sysread($$buffer_ref, $size, $$offset_ref))) { }
0 0 elsif ($bytes_read == 0) { }
5375 0 0 if ($size <= 0)
5382 0 0 if ($stream =~ /^[pt]$/ and defined $details{$stream}{'handle'})
5388 0 0 unless ($details{$stream}{'handle'}->print($header . $$buffer_ref))
5411 0 0 unless ($$this{'mtn_out'}->sysread($err_code, 1))
5416 0 0 if ($err_code != 0)
5427 0 0 if ($details{$ostream}{'used'})
5429 0 0 unless ($details{$ostream}{'handle'}->print($last_msg))
5449 0 0 if (${$details{'e'}{'buffer_ref'};} ne '') { }
0 0 elsif (${$details{'w'}{'buffer_ref'};} ne '') { }
5460 0 0 if ($err_occurred)
5489 0 0 if ($$this{'mtn_pid'} == 0)
5526 0 0 if defined $$this{'db_name'} and not defined $$this{'network_service'}
5534 0 0 if defined $$this{'db_name'}
5535 0 0 if defined $$this{'network_service'}
5536 0 0 unless $$this{'honour_suspend_certs'}
5539 0 0 if (defined $$this{'network_service'}) { }
5559 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'}) { }
5561 0 0 unless chdir 'File::Spec'->rootdir
5566 0 0 unless chdir $$this{'ws_path'}
5579 0 0 if ($exception)
5581 0 0 if ($$ != $my_pid) { }
5611 0 0 unless (defined $mtn_version)
5613 0 0 unless defined($file = 'IO::File'->new('mtn --version |'))
5617 0 0 if ($line =~ /^monotone (\d+\.\d+)(dev)? ./) { }
0 0 elsif ($line =~ /^monotone (\d+\.\d+)([\d.]+)(dev)? ./) { }
5629 0 0 unless defined $mtn_version
5637 0 0 if ($mtn_version > 0.45)
5646 0 0 if (defined $$this{'network_service'})
5658 0 0 if ($poll_result == 0)
5672 0 0 unless ($$this{'mtn_out'}->sysread($char, 1))
5683 0 0 if ($mtn_version > 0.45) { }
5698 0 0 unless ($startup)
5700 0 0 if ($self->interface_version(\$version) and $version =~ /^(\d+)\.(\d+)$/) { }
5712 0 0 if ($$this{'db_is_locked'}) { }
5730 0 0 if not $startup and defined $header_err
5770 0 0 unless -d $ws_path
5774 0 0 if $path eq 'File::Spec'->rootdir
5783 0 0 unless defined($options_fh = 'IO::File'->new($options_file, 'r'))
5823 0 0 unless -f $db_name
5824 0 0 unless defined($db = 'IO::File'->new($db_name, 'r'))
5826 0 0 unless binmode $db
5830 0 0 if $db->sysread($buffer, 15) != 15 or $buffer ne 'SQLite format 3'
5835 0 0 if not $db->sysseek(60, 0) or $db->sysread($buffer, 4) != 4 or $buffer ne '_MTN'
5869 0 0 if (not exists $valid_mtn_options{$$options[$i]}) { }
5943 0 0 if ++$counter == 2147483647
5984 0 0 if (defined $options)
5988 0 0 if (exists $non_arg_options{$$options[$i]}) { }
6036 0 0 unless ($$buffer =~ /$closing_quote_re/)
6067 0 0 unless defined $data