summaryrefslogtreecommitdiff
path: root/git-debrebase
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2017-06-15 00:18:12 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2018-06-16 12:25:49 +0100
commit85644f90c4b887d4b60b175f6cda8446e1e5bd29 (patch)
treed9d9bf9e226db5f43cc3736825089d8f7837a4d1 /git-debrebase
parent6751d0fc1a0a3228fb62ef65206aebcc57b2acdf (diff)
git-debrebase: introduce build_start
Diffstat (limited to 'git-debrebase')
-rwxr-xr-xgit-debrebase21
1 files changed, 10 insertions, 11 deletions
diff --git a/git-debrebase b/git-debrebase
index 3578715..7b64bf5 100755
--- a/git-debrebase
+++ b/git-debrebase
@@ -342,6 +342,12 @@ sub walk {
push @brw_cl, $sp_cl;
push @processed, $sp_cl;
};
+ my $build_start = sub {
+ my ($msg, $parents) = @_;
+ $prline->(" $msg");
+ push @brw_cl, { ExactlyParents => $parents };
+ no qw(exiting); last;
+ };
my $cur = $input;
@@ -365,9 +371,7 @@ sub walk {
for (;;) {
if (!defined $cur) {
- push @brw_cl, { ExactlyParents => [] };
- $prline->("Origin");
- last;
+ $build_start->('Origin', []);
}
$cl = classify $cur;
my $ty = $cl->{Type};
@@ -385,8 +389,7 @@ sub walk {
$cur = $p0;
next;
} elsif ($ty eq 'BreakwaterStart') {
- push @brw_cl, { ExactlyParents => [$cur] };
- last;
+ $build_start('FirstPackaging',[$cur]};
} elsif ($ty eq 'Upstream') {
push @upp_cl, $cl;
$cur = $p0;
@@ -409,9 +412,7 @@ sub walk {
$cur = $ty->{Contributor};
next;
} elsif ($ty eq 'BreakwaterUpstreamMerge') {
- push @brw_cl, { ExactlyParents => [$cur] };
- $prline->("PreviousBreakwater");
- last;
+ $build_start->("PreviousBreakwater", [$cur]);
} elsif ($ty eq 'DgitImportUnpatched') {
my $pm = $pseudomerges[-1];
if (defined $pm) {
@@ -471,12 +472,10 @@ sub walk {
# is already in valid breakwater format, with the
# patches as commits.
printf $report " NoPM" if $report;
- $prline->(" ImportOrigin");
# 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
- push @brw_cl, { ExactlyParents => [$cur] };
- last;
+ $build_start->("ImportOrigin",[$cur]);
}
die "$ty ?";
} else {