summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2018-02-18 13:04:53 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2018-06-16 16:06:59 +0100
commita90cd66b7e31da80fc78134d39c143b3fa0106c8 (patch)
treebc62cde8ba704d19d08c956c7b03a9311773b967
parent9f3a065563b0277ee1ffffc747829884aa986e95 (diff)
git-debrebase: be properly selective about StartRewrite
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rwxr-xr-xgit-debrebase11
1 files changed, 6 insertions, 5 deletions
diff --git a/git-debrebase b/git-debrebase
index c32f257..93bf46b 100755
--- a/git-debrebase
+++ b/git-debrebase
@@ -572,8 +572,9 @@ sub walk ($;$$) {
return (Msg => $ms);
};
my $rewrite_from_here = sub {
+ my ($cl) = @_;
my $sp_cl = { SpecialMethod => 'StartRewrite' };
- push @brw_cl, $sp_cl;
+ push @$cl, $sp_cl;
push @processed, $sp_cl;
};
my $cur = $input;
@@ -623,7 +624,7 @@ sub walk ($;$$) {
my $p0 = @{ $cl->{Parents} }==1 ? $cl->{Parents}[0]{CommitId} : undef;
if ($ty eq 'AddPatches') {
$cur = $p0;
- $rewrite_from_here->();
+ $rewrite_from_here->(\@upp_cl);
next;
} elsif ($ty eq 'Packaging' or $ty eq 'Changelog') {
push @brw_cl, $cl;
@@ -644,14 +645,14 @@ sub walk ($;$$) {
};
$queue->(\@brw_cl, "debian");
$queue->(\@upp_cl, "upstream");
- $rewrite_from_here->();
+ $rewrite_from_here->(\@brw_cl);
$cur = $p0;
next;
} elsif ($ty eq 'Pseudomerge') {
my $contrib = $cl->{Contributor}{CommitId};
print $report " Contributor=$contrib" if $report;
push @pseudomerges, $cl;
- $rewrite_from_here->();
+ $rewrite_from_here->(\@upp_cl);
$cur = $contrib;
next;
} elsif ($ty eq 'Anchor') {
@@ -700,7 +701,7 @@ sub walk ($;$$) {
" anchor")
};
$prline->(" Import");
- $rewrite_from_here->();
+ $rewrite_from_here->(\@brw_cl);
$upp_limit //= $#upp_cl; # further, deeper, patches discarded
$cur = $ovwr;
next;