diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2017-06-21 21:40:24 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-06-16 12:25:49 +0100 |
commit | c3d0030260d0afae7d375977bc36a1f8e7eab8cb (patch) | |
tree | 7690486fd86760b1fd09211234c78a2e2bd8726f /git-debrebase | |
parent | 96b80209efcfc22f5c7e5251b1e1878cad797b5a (diff) |
git-debrebase: rebase: go back to my $build
We never don't have exactly one parent
Diffstat (limited to 'git-debrebase')
-rwxr-xr-x | git-debrebase | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/git-debrebase b/git-debrebase index 4fb5e91..e83822c 100755 --- a/git-debrebase +++ b/git-debrebase @@ -354,9 +354,9 @@ sub walk { }; my $build_start = sub { - my ($msg, $parents) = @_; + my ($msg, $parent) = @_; $prline->(" $msg"); - push @brw_cl, { ExactlyParents => $parents }; + $build = $parent; no warnings qw(exiting); last; }; @@ -369,10 +369,9 @@ sub walk { die "commit $cur: Cannot cope with this commit"; }; + my $build; + for (;;) { - if (!defined $cur) { - $build_start->('Origin', []); - } $cl = classify $cur; my $ty = $cl->{Type}; my $st = $cl->{SubType}; @@ -389,7 +388,7 @@ sub walk { $cur = $p0; next; } elsif ($ty eq 'BreakwaterStart') { - $build_start->('FirstPackaging',[$cur]); + $build_start->('FirstPackaging', $cur); } elsif ($ty eq 'Upstream') { push @upp_cl, $cl; $cur = $p0; @@ -412,7 +411,7 @@ sub walk { $cur = $ty->{Contributor}; next; } elsif ($ty eq 'BreakwaterUpstreamMerge') { - $build_start->("PreviousBreakwater", [$cur]); + $build_start->("PreviousBreakwater", $cur); } elsif ($ty eq 'DgitImportUnpatched') { my $pm = $pseudomerges[-1]; if (defined $pm) { @@ -475,7 +474,7 @@ sub walk { # 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 - $build_start->("ImportOrigin",[$cur]); + $build_start->("ImportOrigin", $cur); } die "$ty ?"; } else { @@ -491,8 +490,6 @@ sub walk { my $rewriting = 0; - my $build = $basis; - my $rm_tree_cached = sub { my ($subdir) = @_; runcmd @git, qw(rm --quiet -rf --cached), $subdir; @@ -531,8 +528,8 @@ sub walk { $rewriting = 1; next; } elsif ($method eq 'RecordBreakwaterTip') { - last if $wantbrwonly; $breakwater = $build; + last if $wantbrwonly; next; } elsif ($method eq 'DgitImportDebianUpdate') { $read_tree_debian->($cltree); |