From: Debian BTS Date: Sat, 9 Aug 2008 18:50:08 +0000 (+0000) Subject: merge changes from don X-Git-Tag: release/2.6.0~486 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=c19c50af1e0b3680fe2edb6c4d307b9460b6fff0;hp=9260707c653138683646791138d95549fa30e9ad;p=debbugs.git merge changes from don --- diff --git a/Debbugs/Log.pm b/Debbugs/Log.pm index c4d741e..5e76351 100644 --- a/Debbugs/Log.pm +++ b/Debbugs/Log.pm @@ -169,7 +169,7 @@ sub new spec => {bug_num => {type => SCALAR, optional => 1, }, - logfh => {type => SCALAR, + logfh => {type => HANDLE, optional => 1, }, log_name => {type => SCALAR, @@ -299,14 +299,36 @@ Takes a .log filehandle as input, and returns an array of all records in that file. Throws exceptions using die(), so you may want to wrap this in an eval(). +Uses exactly the same options as Debbugs::Log::new + =cut -sub read_log_records (*) +sub read_log_records { - my $logfh = shift; + my %param; + if (@_ == 1) { + ($param{logfh}) = @_; + } + else { + %param = validate_with(params => \@_, + spec => {bug_num => {type => SCALAR, + optional => 1, + }, + logfh => {type => HANDLE, + optional => 1, + }, + log_name => {type => SCALAR, + optional => 1, + }, + } + ); + } + if (grep({exists $param{$_} and defined $param{$_}} qw(bug_num logfh log_name)) ne 1) { + croak "Exactly one of bug_num, logfh, or log_name must be passed and must be defined"; + } my @records; - my $reader = Debbugs::Log->new($logfh); + my $reader = Debbugs::Log->new(%param); while (defined(my $record = $reader->read_record())) { push @records, $record; } diff --git a/Debbugs/Recipients.pm b/Debbugs/Recipients.pm index 904106b..a73bbd9 100644 --- a/Debbugs/Recipients.pm +++ b/Debbugs/Recipients.pm @@ -304,7 +304,10 @@ sub determine_recipients { } for (qw(to cc bcc)) { if ($param{$_}) { - return @{$final_recipients{$_}}; + if (exists $final_recipients{$_}) { + return @{$final_recipients{$_}||[]}; + } + return (); } } return %final_recipients; diff --git a/Debbugs/Status.pm b/Debbugs/Status.pm index 1a5e7ae..3b3961f 100644 --- a/Debbugs/Status.pm +++ b/Debbugs/Status.pm @@ -251,7 +251,7 @@ sub read_bug{ # Add log last modified time $data{log_modified} = (stat($log))[9]; $data{location} = $location; - $data{archived} = $location eq 'archive'; + $data{archived} = (defined($location) and ($location eq 'archive'))?1:0; $data{bug_num} = $param{bug}; return \%data; diff --git a/templates/en_US/cgi/short_bug_status.tmpl b/templates/en_US/cgi/short_bug_status.tmpl index 94392d6..8250930 100644 --- a/templates/en_US/cgi/short_bug_status.tmpl +++ b/templates/en_US/cgi/short_bug_status.tmpl @@ -48,8 +48,7 @@ $output = q(Owned by: ).package_links(owner=>$status{owner}).q(;); } $output; -} -Severity: {my $output = $status{severity}; +}Severity: {my $output = $status{severity}; if (isstrongseverity($status{severity})) { $output = q().$status{severity}.q(); } @@ -61,8 +60,7 @@ $output .= q(Merged with ).join(qq(,\n),bug_links(bug=>$status{mergedwith_array})).qq(;\n); } $output; -} -{my $output = ''; +}{my $output = ''; if (@{$status{found_versions}} or @{$status{fixed_versions}}) { $output .= 'Forwarded to " . + join(', ', + map {maybelink($_)} + split /\,\s+/,$status{forwarded} + ).";\n"; + } + $output; +}{ my $output = ''; if (length($status{done})) { $output .= q(Done: ).html_escape($status{done}).q(; ) } $output; -} -{ my $output = ''; +}{ my $output = ''; if (@{$status{blockedby_array}}) { $output .= q(Fix blocked by ). join(q(, ),