------------------------------------------------------------ revno: 864 committer: Debian BTS <[EMAIL PROTECTED]> branch nick: mainline timestamp: Sun 2008-08-10 19:43:55 +0000 message: merge changes from don ------------------------------------------------------------ revno: 738.1.444 merged: [EMAIL PROTECTED] committer: Don Armstrong <[EMAIL PROTECTED]> branch nick: source timestamp: Sun 2008-08-10 12:41:58 -0700 message: support testing merge/unmerge/forcemerge ------------------------------------------------------------ revno: 738.1.443 merged: [EMAIL PROTECTED] committer: Don Armstrong <[EMAIL PROTECTED]> branch nick: source timestamp: Sun 2008-08-10 12:41:39 -0700 message: include hook bits too ------------------------------------------------------------ revno: 738.1.442 merged: [EMAIL PROTECTED] committer: Don Armstrong <[EMAIL PROTECTED]> branch nick: source timestamp: Sun 2008-08-10 12:41:24 -0700 message: set current line length to zero in wrap_to_length ------------------------------------------------------------ revno: 738.1.441 merged: [EMAIL PROTECTED] committer: Don Armstrong <[EMAIL PROTECTED]> branch nick: source timestamp: Sun 2008-08-10 12:41:01 -0700 message: * fix locking in lock_read_all_merge_bugs ------------------------------------------------------------ revno: 738.1.440 merged: [EMAIL PROTECTED] committer: Don Armstrong <[EMAIL PROTECTED]> branch nick: source timestamp: Sun 2008-08-10 08:47:57 -0700 message: * Add bug archiveable support to PKgreport.pm ------------------------------------------------------------ revno: 738.1.439 merged: [EMAIL PROTECTED] committer: Don Armstrong <[EMAIL PROTECTED]> branch nick: source timestamp: Sun 2008-08-10 08:47:30 -0700 message: * add missing span elements ------------------------------------------------------------ revno: 738.1.438 merged: [EMAIL PROTECTED] committer: Don Armstrong <[EMAIL PROTECTED]> branch nick: source timestamp: Sun 2008-08-10 08:46:35 -0700 message: * add support for archive days output in short bug status
=== modified file 'Debbugs/CGI/Pkgreport.pm' --- Debbugs/CGI/Pkgreport.pm 2008-08-10 15:38:24 +0000 +++ Debbugs/CGI/Pkgreport.pm 2008-08-10 19:43:52 +0000 @@ -235,8 +235,11 @@ push @{$status{blocks_array}}, {bug_num => $b, subject => $s{subject}, status => \%s}; } } - - + my $days = bug_archiveable(bug => $status{id}, + status => \%status, + days_until => 1, + ); + $status{archive_days} = $days; return fill_in_template(template => 'cgi/short_bug_status', variables => {status => \%status, isstrongseverity => \&Debbugs::Status::isstrongseverity,
=== modified file 'Debbugs/Status.pm' --- Debbugs/Status.pm 2008-08-10 15:38:24 +0000 +++ Debbugs/Status.pm 2008-08-10 19:43:52 +0000 @@ -321,20 +321,24 @@ sub lock_read_all_merged_bugs { my ($bug_num,$location) = @_; + my $locks = 0; my @data = (lockreadbug(@_)); if (not @data and not defined $data[0]) { - return (0,undef); + return ($locks,undef); } + $locks++; if (not length $data[0]->{mergedwith}) { - return (1,@data); + return ($locks,@data); } unfilelock(); + $locks--; filelock("$config{spool_dir}/lock/merge"); - my $locks = 0; + $locks++; @data = (lockreadbug(@_)); if (not @data and not defined $data[0]) { unfilelock(); #for merge lock above - return (0,undef); + $locks--; + return ($locks,undef); } $locks++; my @bugs = split / /, $data[0]->{mergedwith}; @@ -355,15 +359,15 @@ } # perform a sanity check to make sure that the merged bugs are # all merged with eachother - my $expectmerge= join(' ',grep($_ != $bug, sort { $a <=> $b } @bugs)); + my $expectmerge= join(' ',grep {$_ != $bug } sort { $a <=> $b } (@bugs,$bug_num)); if ($newdata->{mergedwith} ne $expectmerge) { for (1..$locks) { unfilelock(); } - die "Bug $bug_num differs from bug $bug: ($newdata->{mergedwith}) vs. ($expectmerge) (".join(' ',@bugs).")"; + die "Bug $bug_num differs from bug $bug: ($newdata->{bug_num}: $newdata->{mergedwith}) vs. ($expectmerge) (".join(' ',@bugs).")"; } } - return (2,@data); + return ($locks,@data); } === modified file 'Debbugs/User.pm' --- Debbugs/User.pm 2008-08-10 15:38:24 +0000 +++ Debbugs/User.pm 2008-08-10 19:43:52 +0000 @@ -400,7 +400,7 @@ sub _wrap_to_length { my ($content,$line_length) = @_; - my $current_line_length; + my $current_line_length = 0; my $result = ""; while ($content =~ m/^([^,]*,\s*)(.*)$/ || $content =~ m/^([^,]+)()$/) { my $current_word = $1; === modified file 'scripts/service' --- scripts/service 2008-08-10 15:38:24 +0000 +++ scripts/service 2008-08-10 19:43:52 +0000 @@ -17,7 +17,7 @@ use Debbugs::Common qw(:util :quit :misc :lock); -use Debbugs::Status qw(:read :status :write :versions); +use Debbugs::Status qw(:read :status :write :versions :hook); use Debbugs::MIME qw(decode_rfc1522 encode_rfc1522); use Debbugs::Mail qw(send_mail_message); === modified file 't/06_mail_handling.t' --- t/06_mail_handling.t 2008-08-10 15:38:34 +0000 +++ t/06_mail_handling.t 2008-08-10 19:43:52 +0000 @@ -1,7 +1,7 @@ # -*- mode: cperl;-*- # $Id: 05_mail.t,v 1.1 2005/08/17 21:46:17 don Exp $ -use Test::More tests => 84; +use Test::More tests => 96; use warnings; use strict; @@ -206,6 +206,27 @@ status_key => 'owner', status_value => '', }, + clone => {command => 'clone', + value => '-1', + status_key => 'package', + status_value => 'foo', + bug => '2', + }, + merge => {command => 'merge', + value => '1 2', + status_key => 'mergedwith', + status_value => '2', + }, + unmerge => {command => 'unmerge', + value => '', + status_key => 'mergedwith', + status_value => '', + }, + forcemerge => {command => 'forcemerge', + value => '2', + status_key => 'mergedwith', + status_value => '2', + }, summary => {command => 'summary', value => '5', status_key => 'summary', @@ -271,10 +292,15 @@ '[EMAIL PROTECTED]'. "$command message was parsed without errors"); # now we need to check to make sure that the control message actually did anything my $status; - $status = read_bug(bug=>1, + $status = read_bug(exists $control_command->{bug}?(bug => $control_command->{bug}):(bug=>1), exists $control_command->{location}?(location => $control_command->{location}):(), ); - is_deeply($status->{$control_command->{status_key}},$control_command->{status_value},"bug 1 $command") + is_deeply($status->{$control_command->{status_key}}, + $control_command->{status_value}, + "bug " . + (exists $control_command->{bug}?$control_command->{bug}:1). + " $command" + ) or fail(Dumper($status)); } @@ -286,6 +312,7 @@ Subject => "Munging a bug with unarchivearchive", ], body => <<'EOF') or fail 'message to [EMAIL PROTECTED] failed'; +debug 10 archive 1 unarchive 1 submitter 1 [EMAIL PROTECTED] === modified file 'templates/en_US/cgi/short_bug_status.tmpl' --- templates/en_US/cgi/short_bug_status.tmpl 2008-08-10 15:38:24 +0000 +++ templates/en_US/cgi/short_bug_status.tmpl 2008-08-10 19:43:52 +0000 @@ -97,6 +97,17 @@ } $output; }{ my $output = ''; + my $days = $status{archive_days}; + if ($days >= 0 and defined $status{location} and $status{location} ne 'archive') { + $output .= "<span><strong>Can be archived" . + ( $days == 0 ? " today" : $days == 1 ? " in $days day" : " in $days days" ) . + "</strong></span>;\n"; + } + elsif (defined $status{location} and $status{location} eq 'archived') { + $output .= "<span><strong>Archived</strong></span>;\n"; + } + $output; +}{ my $output = ''; if (@{$status{blockedby_array}}) { $output .= q(<span>Fix blocked by ). join(q(, ),