From: Don Armstrong Date: Mon, 5 Sep 2016 16:11:13 +0000 (-0700) Subject: Fix (and test) setting summary/outlook in Control: messages (Closes: #836613). X-Git-Tag: release/2.6.0~170 X-Git-Url: https://git.donarmstrong.com/?p=debbugs.git;a=commitdiff_plain;h=4118f90e5b711616eeff28aef36615b0a892b57f Fix (and test) setting summary/outlook in Control: messages (Closes: #836613). --- diff --git a/Debbugs/Control.pm b/Debbugs/Control.pm index 226cd1f..416abc1 100644 --- a/Debbugs/Control.pm +++ b/Debbugs/Control.pm @@ -2748,7 +2748,7 @@ sub _summary { print {$debug} "Removing $cmd fields\n"; $action = "Removed $cmd"; } - elsif ($param{$cmd} =~ /^\d+$/) { + elsif ($param{$cmd} =~ /^-?\d+$/) { my $log = []; my @records = Debbugs::Log::read_log_records(bug_num => $param{bug}); if ($param{$cmd} == 0 or $param{$cmd} == -1) { diff --git a/debian/changelog b/debian/changelog index b91355b..3729408 100644 --- a/debian/changelog +++ b/debian/changelog @@ -36,6 +36,8 @@ debbugs (2.6.0~exp1) UNRELEASED; urgency=low newer versions of SOAP::Lite. (Closes: #785405) * Add patch to do singular/plural in error messages from Rafael. (Closes: #790716) + * Fix (and test) setting summary/outlook in Control: messages (Closes: + #836613). [Thanks to Arnout Engelen: ] * Add Homepage (closes: #670555). diff --git a/scripts/process b/scripts/process index 4c38000..2f4341c 100755 --- a/scripts/process +++ b/scripts/process @@ -1015,7 +1015,7 @@ if (@control_bits) { request_subject => $header{subject}, request_nn => $nn, request_replyto => $replyto, - message => $msg, + message => [$msg], affected_bugs => \%bug_affected, affected_packages => \%affected_packages, recipients => \%recipients, diff --git a/t/19_summary_current_message.t b/t/19_summary_current_message.t new file mode 100644 index 0000000..0dfc1e7 --- /dev/null +++ b/t/19_summary_current_message.t @@ -0,0 +1,91 @@ +# -*- mode: cperl;-*- + +use Test::More; + +use warnings; +use strict; + +# The test functions are placed here to make things easier +use lib qw(t/lib); +use DebbugsTest qw(:all); +use Data::Dumper; + +my %config = + create_debbugs_configuration(); + +my $sendmail_dir = $config{sendmail_dir}; +my $spool_dir = $config{spool_dir}; + +# We're going to use create mime message to create these messages, and +# then just send them to receive. + +send_message(to=>'submit@bugs.something', + headers => [To => 'submit@bugs.something', + From => 'foo@bugs.something', + Subject => 'Submiting a bug', + ], + body => < 'control@bugs.something', + headers => [To => 'control@bugs.something', + From => 'foo@bugs.something', + Subject => 'Munging a bug', + ], + body => <1); +is($status->{summary},"This is the summary of the silly bug",'bug 1 has right summary'); + +send_message(to => '1@bugs.something', + headers => [To => '1@bugs.something', + From => 'foo@bugs.something', + Subject => 'Munging a bug', + ], + body => <1); +is($status->{summary},"This is a new summary.",'Control: summary setting works'); + + +done_testing();