use Debian::Dgit qw(:DEFAULT $wa);
+sub badusage ($) {
+ my ($m) = @_;
+ die "bad usage: $m\n";
+}
+
sub cfg ($) {
my ($k) = @_;
$/ = "\0";
if ($differs & D_UPS) {
printf $report " D_UPS" if $report;
push @deb_cl, {
- %r,
+ %$cl,
SpecialMethod => 'DgitImportUpstreamUpdate',
$xmsg->("convert dgit import: debian changes")
};
}
push @deb_cl, {
- %r,
+ %$cl,
SpecialMethod => 'DgitImportDebianUpdate',
$xmsg->("convert dgit import: upstream changes")
};
$current_method = $cl;
next;
}
- $method = $cl->{SpecialMethod} // $current_method;
+ my $method = $cl->{SpecialMethod} // $current_method;
my @parents = ($build);
- my $cltree = $cl->{CommitId}
+ my $cltree = $cl->{CommitId};
if ($method eq 'Debian') {
$read_tree_debian->($cltree);
} elsif ($method eq 'Upstream') {
next;
} elsif ($method eq 'DgitImportDebianUpdate') {
$read_tree_debian->($cltree);
- $rm_tree_cached(qw(debian/patches));
+ $rm_tree_cached->(qw(debian/patches));
} elsif ($method eq 'DgitImportUpstreamUpdate') {
$read_tree_upstream->($cltree);
push @parents, map { $_->{CommitId} } @{ $cl->{OrigParents} };
my $ch = $cl->{Hdr};
$ch =~ s{^tree .*}{tree $newtree}m or confess "$ch ?";
$ch =~ s{^parent .*\n}{}m;
- $ch =~ s{(?=^author}{
+ $ch =~ s{(?=^author)}{
map { "parent $_\n" } @parents
}me or confess "$ch ?";
- if ($rewrite) {
+ if ($rewriting) {
$ch =~ s{^committer .*$}{$committer_authline}m
or confess "$ch ?";
}
- my $cf = "$rd/m$rewrite"
- open CD, ">", $cf or die $!;
- print CD $ch, "\n", $cl->{Msg}; or die $!;
+ my $cf = "$rd/m$rewriting";
+ open CD, ">", $cf or die $!;
+ print CD $ch, "\n", $cl->{Msg} or die $!;
close CD or die $!;
my @cmd = (@git, qw(hash-object));
- push @cmd, qw(-w) if $rewrite;
+ push @cmd, qw(-w) if $rewriting;
push @cmd, qw(-t commit), $cf;
my $newcommit = cmdoutput @cmd;
- confess "$ch ?" unless $rewrite or $newcommit eq $cl->{CommitId};
+ confess "$ch ?" unless $rewriting or $newcommit eq $cl->{CommitId};
$build = $newcommit;
}
};
runcmd @git, qw(diff-tree --quiet),
- map { $wantdebonly ? "$_:debian" : $_ },
+ map { $wantdebonly ? "$_:debian" : $_ }
$input, $build;
return ($build, $breakwater);