diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-02-16 20:24:56 +0000 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-06-16 16:03:11 +0100 |
commit | da894f5bc73ad2a5cbf6d74533818ca359f141b0 (patch) | |
tree | 157ce9106c25c16d48ba2f09f8e0978e63ad840b | |
parent | cd2fb073d878511939ff074c19729acf6d598365 (diff) |
git-debrebase: DgitImportUnpatched: defer upstream diff check
We can't do this during the initial walk, because what we ought to be
comparing is the previous breakwater with the new one. So we have to
wait until the walk has proceeded down the overwritten branch, to find
the old breakwater.
This can be done by waiting until we are rebuilding the branch: at
that point, we have just built the previous breakwater, so we can
compare it to the dgit unpatched import.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rwxr-xr-x | git-debrebase | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/git-debrebase b/git-debrebase index bdde809..ad2672f 100755 --- a/git-debrebase +++ b/git-debrebase @@ -651,22 +651,12 @@ sub walk ($;$$) { %$cl, SpecialMethod => 'DgitImportDebianUpdate', $xmsg->("convert dgit import: debian changes") + }, { + %$cl, + SpecialMethod => 'DgitImportUpstreamUpdate', + $xmsg->("convert dgit import: upstream update", + " breakwater") }; - my $differs = (get_differs $ovwr, $cl->{Tree}); - printf $report " Differs=%#x", $differs if $report; - if ($differs & D_UPS) { - printf $report " D_UPS" if $report; - # This will also trigger if a non-dgit git-based NMU - # deleted .gitignore (which is a thing that some of - # the existing git tools do if the user doesn't - # somehow tell them not to). Ah well. - push @brw_cl, { - %$cl, - SpecialMethod => 'DgitImportUpstreamUpdate', - $xmsg->("convert dgit import: upstream changes", - " breakwater") - }; - } $prline->(" Import"); $rewrite_from_here->(); $upp_limit //= $#upp_cl; # further, deeper, patches discarded @@ -749,6 +739,9 @@ sub walk ($;$$) { $read_tree_debian->($cltree); rm_subdir_cached qw(debian/patches); } elsif ($method eq 'DgitImportUpstreamUpdate') { + confess unless $rewriting; + my $differs = (get_differs $build, $cltree); + next unless $differs & D_UPS; $read_tree_upstream->($cltree); push @parents, map { $_->{CommitId} } @{ $cl->{OrigParents} }; } else { |