Branch Coverage

blib/lib/App/Sqitch/Engine.pm
Criterion Covered Total %
branch 183 208 87.9


line true false branch
164 1 143 unless my $target = $p->{'target'}
167 1 142 unless my $ekey = $target->engine_key
172 2 140 unless eval "require $pkg"
183 1 5 if $class eq __PACKAGE__
204 14 0 if $@
220 1 12 if $to_index < 0
222 8 4 if (defined $to)
229 1 6 if ($to_index == $position)
238 1 9 if ($position == $to_index) { }
7 2 elsif ($position == -1) { }
245 3 4 if ($self->initialized) { }
258 1 1 if $to_index < $position
264 5 3 defined $to ? :
285 3 1 $mode eq 'all' ? :
2 4 $mode eq 'tag' ? :
2 6 $mode eq 'change' ? :
315 14 1 if (defined $prompt) { }
316 0 14 unless defined $prompt_default
336 7 7 if (defined $to) { }
339 3 4 unless (my($change) = $self->_load_changes($self->change_for_key($to)))
341 1 2 if ($plan->find($to))
359 1 3 unless (@changes = $self->deployed_changes_since($self->_load_changes($change)))
369 2 1 if ($prompt) { }
380 1 1 unless $sqitch->ask_yes_no(&__x("Revert changes to {change} from {destination}?", "change", $change->format_name_with_tags, "destination", $self->destination), $prompt_default)
393 3 4 unless (@changes = $self->deployed_changes)
400 3 1 if ($prompt) { }
410 1 2 unless $sqitch->ask_yes_no(&__x("Revert all changes from {destination}?", "destination", $self->destination), $prompt_default)
453 2 6 unless (@changes)
454 1 1 $plan->count ? :
461 1 5 if ($plan->count == 0)
471 1 4 if (my $count = $self->_verify_changes($from_idx, $to_idx, !$to, @changes))
475 0 1 if @changes > $num_changes
493 8 3 unless defined $from
500 3 9 if defined $to
501 1 8 if (my $id = $self->latest_change_id)
530 9 7 if ($pop) { }
566 20 1 if (defined $plan_index) { }
568 4 16 if ($plan_index != $from_idx + $i)
583 19 2 unless $reworked
586 7 14 $errs ? :
592 14 2 if defined &first(sub {
605 1 13 if ($pending and $to_idx < $plan->count - 1)
606 1 0 if (my(@pending) = map({$plan->change_at($_);} $to_idx + 1 .. $plan->count - 1))
625 11 9 if (-e $file)
663 7 2 unless $seen{$_->id // ""}
668 2 8 if (my $req = $seen{$_->id // ''}) { }
677 5 3 if (@conflicts or @required)
682 4 1 if @conflicts = &$listof(@conflicts)
689 2 3 if @required = &$listof(@required)
700 1 2 if (my(@ids) = $self->are_deployed_changes(@changes))
720 1 4 unless my(@requiring) = grep({not $seen{$_->{'change_id'}};} $self->changes_requiring_change($change))
732 3 3 $_->{'project'} eq $proj ? :
737 3 1 if @msg
747 1 16 unless defined $dep->id or defined $dep->change or defined $dep->tag
770 7 19 if $tag
771 2 17 if $cname =~ /^[0-9a-f]{40}$/
772 2 15 if $cname eq "HEAD" or $cname eq "ROOT"
822 1 44 unless $params
831 5 39 if (defined(my $prev_idx = $seen{$params->{'name'}}))
843 2 42 if (defined(my $reworked_idx = eval {
879 0 1 if @{$ids;} <= 1
892 0 2 if (my $change = $plan->find($id)) { }
917 10 0 if (my(@run) = reverse(@_))
918 3 7 $tagged ? :
919 6 4 $tagged ? :
945 8 14 if ($change->tags)
951 4 1 if (my $ident = eval {
952 2 2 unless $ident eq "private"
973 4 1 if (my $ident = &try(sub {
974 2 2 unless $ident eq "private"
988 1 20 if ($self->_no_registry) { }
8 12 elsif (my $state = $self->current_state) { }
995 0 0 unless $state->{'tags'}
1000 1 7 unless (exists $state->{'script_hash'})
1009 3 5 if $state->{'script_hash'} and $state->{'script_hash'} eq $state->{'change_id'}
1013 7 1 if (my(@tags) = $change->tags) { }
1028 1 1 $thing->isa('App::Sqitch::Plan::Tag') ? :
1045 1 74 unless -e $file
1049 58 16 unless $self->log_only
1051 5 61 if $self->with_verify
1064 6 3 unless $self->log_only
1093 1 40 unless -e $file
1097 30 10 unless $self->log_only
1119 1 3 if $self->_locked
1120 1 2 if $self->try_lock
1131 1 1 if $self->wait_lock
1151 0 0 if (my $ret = &$code())
1155 0 0 if $secs < 0
1191 31 5 if $newver == $oldver
1193 3 2 if $oldver == 0 and not $self->initialized
1198 1 1 if $newver < $oldver
1204 1 0 if $newver > $oldver
1213 0 0 unless $self->needs_upgrade
1219 0 0 if $newver < $oldver
1234 0 0 unless @scripts and $scripts[-1][0] == $newver
1268 5 4 if $i + $from_idx >= $plan->count or $change->script_hash ne $plan->change_at($i + $from_idx)->script_hash
1280 0 1 if $divergent_idx == -1
1281 0 1 if $divergent_idx == 0
1298 2 6 unless (@deployed_changes)
1299 1 1 $plan->count ? :
1311 4 2 if ($divergent_change_idx != -1)
1320 4 2 if $num_failed
1336 0 6 if $_[0]->_no_registry
1347 0 0 unless $self->_initialize