push @brw_cl, $sp_cl;
push @processed, $sp_cl;
};
-
my $cur = $input;
my $prdelim = "";
$prdelim = "\n";
};
+ my $build_start = sub {
+ my ($msg, $parents) = @_;
+ $prline->(" $msg");
+ push @brw_cl, { ExactlyParents => $parents };
+ no warnings qw(exiting); last;
+ };
+
my $bomb = sub { # usage: return $bomb->();
print $report " Unprocessable" if $report;
$prprdelim->();
for (;;) {
if (!defined $cur) {
- push @brw_cl, { ExactlyParents => [] };
- $prline->("Origin");
- last;
+ $build_start->('Origin', []);
}
$cl = classify $cur;
my $ty = $cl->{Type};
$cur = $p0;
next;
} elsif ($ty eq 'BreakwaterStart') {
- push @brw_cl, { ExactlyParents => [$cur] };
- last;
+ $build_start->('FirstPackaging',[$cur]);
} elsif ($ty eq 'Upstream') {
push @upp_cl, $cl;
$cur = $p0;
$cur = $ty->{Contributor};
next;
} elsif ($ty eq 'BreakwaterUpstreamMerge') {
- push @brw_cl, { ExactlyParents => [$cur] };
- $prline->("PreviousBreakwater");
- last;
+ $build_start->("PreviousBreakwater", [$cur]);
} elsif ($ty eq 'DgitImportUnpatched') {
my $pm = $pseudomerges[-1];
if (defined $pm) {
}
$prline->(" Import");
$rewrite_from_here->();
- $upp_limit //= $#upp; # further, deeper, patches discarded
+ $upp_limit //= $#upp_cl; # further, deeper, patches discarded
$cur = $ovwr;
next;
} else {
# is already in valid breakwater format, with the
# patches as commits.
printf $report " NoPM" if $report;
- $prline->(" ImportOrigin");
# last thing we processed will have been the first patch,
# if there is one; which is fine, so no need to rewrite
# on account of this import
- push @brw_cl, { ExactlyParents => [$cur] };
- last;
+ $build_start->("ImportOrigin",[$cur]);
}
die "$ty ?";
} else {