We collect various git objects that we may want to present to the user
as wreckage. Currently we dump them in $cl and print them out in
$nomerge. We'll want to do better than that of course.
Also, we don't collect any wreckage for the actual series merge yet.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
fail "something useful about failed merge attempt @_ xxx".Dumper($cl);
};
fail "something useful about failed merge attempt @_ xxx".Dumper($cl);
};
+ my $mwrecknote = sub {
+ my ($reftail, $commitish) = @_;
+ $cl->{MergeWreckNotes}{$reftail} = $commitish;
+ };
+
my $last_anchor;
for (;;) {
my $last_anchor;
for (;;) {
+ $mwrecknote->('vanilla-merge', $cl->{CommitId});
+
foreach my $p (@$ps) {
$prline->(" VanillaMerge ".$p->{Ix});
$prprdelim->();
foreach my $p (@$ps) {
$prline->(" VanillaMerge ".$p->{Ix});
$prprdelim->();
$p->{Breakwater} = $p->{SeriesBase} = $pbw;
$p->{Anchor} = $panchor;
$p->{Breakwater} = $p->{SeriesBase} = $pbw;
$p->{Anchor} = $panchor;
+ my $lr = $p->{LeftRight} = (qw(left right))[$p->{Ix}];
+ $mwrecknote->("$lr-input", $p->{CommitId});
+
+ my $mwrecknote_parent = sub {
+ my ($which) = @_;
+ $mwrecknote->("$lr-".(lc $which), $p->{$which});
+ };
+ $mwrecknote_parent->('Laundered');
+ $mwrecknote_parent->('Breakwater');
+ $mwrecknote_parent->('Anchor');
+
$best_anchor = $panchor if
!defined $best_anchor or
is_fast_fwd $best_anchor, $panchor;
$best_anchor = $panchor if
!defined $best_anchor or
is_fast_fwd $best_anchor, $panchor;
+ $mwrecknote->('result-anchor', $best_anchor);
+
foreach my $p (@$ps) {
$prline->(" VanillaMerge ".$p->{Ix});
if (!is_fast_fwd $p->{Anchor}, $best_anchor) {
foreach my $p (@$ps) {
$prline->(" VanillaMerge ".$p->{Ix});
if (!is_fast_fwd $p->{Anchor}, $best_anchor) {
@ibs or confess 'internal error, expected anchor at least ?';
my $ib;
@ibs or confess 'internal error, expected anchor at least ?';
my $ib;
foreach my $tibix (0..$#ibs) {
my $tib = $ibs[$tibix];
my $ff = is_fast_fwd $bwb, $tib;
foreach my $tibix (0..$#ibs) {
my $tib = $ibs[$tibix];
my $ff = is_fast_fwd $bwb, $tib;
+ my $ok = !$ff ? 'rej' : $ib ? 'extra' : 'ok';
+ my $tibleaf = "interchange-mbcand-$ok-$tibix";
+ $mwrecknote->($tibleaf, $tib);
next unless $ff;
next if $ib;
$ib = $tib;
next unless $ff;
next if $ib;
$ib = $tib;
}
$ib or $nomerge->("no suitable interchange merge base");
$prline->(" VanillaMerge Base");
$prprdelim->();
}
$ib or $nomerge->("no suitable interchange merge base");
$prline->(" VanillaMerge Base");
$prprdelim->();
- my ($btip, $bbw, $banchor) =
+ my ($btip, $bbw, $banchor) = eval {
walk $ib, 0, $report, $report_lprefix.' ';
walk $ib, 0, $report, $report_lprefix.' ';
+ };
+ $nomerge->("walking interchange branch merge base ($ibleaf): ".
+ $@) if length $@;
+
+ $mwrecknote->("mergebase-laundered", $btip);
+ $mwrecknote->("mergebase-breakwater", $bbw);
+ $mwrecknote->("mergebase-anchor", $banchor);
my $ibinfo = { SeriesTip => $btip,
SeriesBase => $bbw,
my $ibinfo = { SeriesTip => $btip,
SeriesBase => $bbw,