X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=blobdiff_plain;f=git-debrebase;h=672551d5e921ea30ad7728952b2602e5e98c7299;hp=8ddf18dacf295670ba07270bfd5f2987d47c26f9;hb=099608874f16c22a774ff9f427a8f172c84c66f9;hpb=cd7d350f25a111bec0843ff4cb60507ee92e4677 diff --git a/git-debrebase b/git-debrebase index 8ddf18da..672551d5 100755 --- a/git-debrebase +++ b/git-debrebase @@ -810,6 +810,21 @@ sub classify ($) { return $classify->("VanillaMerge"); } +sub keycommits ($;$$$$$); + +sub mergedbreakwaters_anchor ($) { + my ($cl) = @_; + my $best_anchor; + foreach my $p (@{ $cl->{Parents} }) { + my ($panchor, $pbw) = keycommits $p->{CommitId}, + undef,undef,undef,undef, 1; + $best_anchor = $panchor + if !defined $best_anchor + or is_fast_fwd $best_anchor, $panchor; + } + return $best_anchor; +} + sub keycommits ($;$$$$$) { my ($head, $furniture, $unclean, $trouble, $fatal, $claimed_bw) = @_; # => ($anchor, $breakwater) @@ -901,6 +916,8 @@ sub keycommits ($;$$$$$) { $x->($trouble, 'vanillamerge', "found vanilla merge"," ($head)"); return (undef,undef); + } elsif ($ty eq 'MergedBreakwaters') { + $found_anchor->(mergedbreakwaters_anchor $cl); } else { $x->($fatal, 'unprocessable', "found unprocessable commit, cannot cope: $cl->{Why}",