dbg($self, 'trying '.di_url($self, $nxt));
return do_git_apply($self);
} else {
+ $msg .= " (no patches left to try for $di->{oid_b})\n";
ERR($self, $msg);
}
} else {
my $diffs = delete $self->{tmp_diffs};
if (scalar @$diffs) {
unshift @{$self->{patches}}, @$diffs;
- dbg($self, "found $want->{oid_b} in " . join(" ||\n\t",
- map { di_url($self, $_) } @$diffs));
+ my %seen; # List::Util::uniq requires Perl 5.26+ :<
+ my @u = grep { !$seen{$_}++ } map { di_url($self, $_) } @$diffs;
+ dbg($self, "found $want->{oid_b} in " . join(" ||\n\t", @u));
++$self->{nr_p};
# good, we can find a path to the oid we $want, now
# scan through inboxes to look for emails which results in
# the oid we want:
- my $ibx = shift(@{$want->{try_ibxs}}) or die 'BUG: {try_ibxs} empty';
+ my $ibx = shift(@{$want->{try_ibxs}}) or return done($self, undef);
if (my $msgs = find_smsgs($self, $ibx, $want)) {
$want->{try_smsgs} = $msgs;
$want->{cur_ibx} = $ibx;
sub new {
my ($class, $ibx, $user_cb, $uarg) = @_;
- bless {
- gits => $ibx->{-repo_objs},
+ bless { # $ibx is undef if coderepo only (see WwwCoderepo)
+ gits => $ibx ? $ibx->{-repo_objs} : undef,
user_cb => $user_cb,
uarg => $uarg,
# -cur_di, -qsp_err, -msg => temp fields for Qspawn callbacks
# TODO: config option for searching related inboxes
- inboxes => [ $ibx ],
+ inboxes => $ibx ? [ $ibx ] : [],
}, $class;
}