our $overwrite_version; # undef: not specified; '': check changelog
our $quilt_mode;
our $quilt_modes_re = 'linear|smash|auto|nofix|nocheck|gbp|dpm|unapplied';
+our $delayed;
our $dodep14tag;
our $split_brain_save;
our $we_are_responder;
'dgit-distro.debian.git-check' => 'url',
'dgit-distro.debian.git-check-suffix' => '/info/refs',
'dgit-distro.debian.new-private-pushers' => 't',
+ 'dgit-distro.debian.nmudiff-qateam' => 'packages@qa.debian.org',
'dgit-distro.debian/push.git-url' => '',
'dgit-distro.debian/push.git-host' => 'push.dgit.debian.org',
'dgit-distro.debian/push.git-user-force' => 'dgit',
}
}
+sub nmudiff_email_prepare ($) {
+ my ($changes) = @_;
+ if ($donmudiff eq 'no') {
+ return;
+ } elsif ($donmudiff eq 'always') {
+ } elsif ($donmudiff eq 'auto') {
+ my %maints;
+ foreach my $f qw(Maintainer Uploaders) {
+ my $maints = $dsc->{$f};
+ next unless defined $maints;
+ $maints{ $_->address }=1 foreach parse Mail::Address $maints;
+ }
+ return unless grep { defined && $maints{$_} },
+ (access_cfg 'nmudiff-qateam', 'RETURN-UNDEF'),
+ (getfield $changes, 'Changed-By');
+ progress
+ "NMU (neither QA nor Changed-By is in Maintainer/Uploaders).";
+ } else {
+ die $donmudiff;
+ }
+
+ my @closes = split /\s+/, $dctrl->{Closes} // '';
+ if (@closes==1) {
+ push @header, <<END;
+To: $closes[0]\@$domain
+Subject: #$closes[0]: Fixed in NMU ($package $version)
+END
+ } else {
+ push @header, <<END;
+To: $newbug
+Subject: $source: diff for NMU version $version
+END
+ }
+ push @header, <<END:
+X-Mailer: dgit ($our_version)
+END
+
+ push @body, <<END;
+Dear Maintainer,
+
+I've prepared an NMU for $package, version $version.
+END
+
+ if (defined $delayed) {
+ push @psuedoheader, <<END;
+Control: tags -1 + patch
+Control: fixed -1 $version
+END
+ push @body, <<END:
+I have just uploaded it to DELAYED/$delay.
+END
+ } else {
+ push @pseudoheader, <<END foreach @closes;
+Control: tags $_ + patch
+Control: fixed $_ $version
+END
+ push @body, <<END:
+I have just uploaded it to $csuite.
+END
+ }
+
+ push @body, <<END;
+
+The diff is attached to this message.
+
+FYI I used git and dgit to prepare the new version.
+You can find my changes as git commits in the dgit git repository:
+END
+ my @urls;
+ push @urls, access_giturl;
+ my $u2= do { local $access_forpush=0; access_giturl; };
+ push @urls, $u2 unless grep { $_ eq $u2 } @urls;
+ push @body, " ",$_,"\n" foreach @urls;
+ push @body, <<END;
+in the remote ref
+ refs/dgit/$csuite xxx
+so e.g.
+ git fetch $urls[0] xxx
+ git log FETCH_HEAD
+
+My commits are from $previous
+(previous dgit tip for $csuite)
+to $current ($tagname):
+END
+ if (madformat) {
+ push @body, <<END;
+If you are not a dgit user, depending on your own git workflow, you
+may want to: cherry pick the relevant individual changes; rebase
+(perhaps selectively); and/or copy (perhaps dgit-generated) patches
+from debian/patches/.
+END
+ } else {
+ push @body, <<END;
+If you are not a dgit user, depending on your own git workflow, you
+may want to rebase the dgit branch onto your own history.
+END
+ }
+
sub dopush () {
printdebug "actually entering push\n";
# Checks complete, we're going to try and go ahead:
+ numdiff_email_prepare($changes);
+
responder_send_file('changes',$changesfile);
responder_send_command("param head $dgithead");
responder_send_command("param csuite $csuite");
push @ropts, $_;
$overwrite_version = $1;
} elsif (m/^--delayed=(\d+)$/s) {
+ $delayed= $1 + 0;
push @ropts, $_;
push @dput, $_;
} elsif (m/^--dgit-view-save=(.+)$/s) {