]> git.donarmstrong.com Git - debbugs.git/blobdiff - cgi/bugreport.cgi
fix bug where boring versions were included while collapsing
[debbugs.git] / cgi / bugreport.cgi
index 5f56eaaa992049e1bc3886421c682af85d7a13c5..88e251f14a6ec11700aa5bc4aec5af070a3c33ba 100755 (executable)
@@ -14,9 +14,9 @@ use Debbugs::Config qw(:globals :text);
 use Debbugs::Log;
 use Debbugs::MIME qw(convert_to_utf8 decode_rfc1522 create_mime_message);
 use Debbugs::CGI qw(:url :html :util);
-use Debbugs::Common qw(buglog);
+use Debbugs::Common qw(buglog getmaintainers);
 use Debbugs::Packages qw(getpkgsrc);
-use Debbugs::Status qw(get_bug_status isstrongseverity);
+use Debbugs::Status qw(splitpackages get_bug_status isstrongseverity);
 
 use Scalar::Util qw(looks_like_number);
 use CGI::Simple;
@@ -37,6 +37,7 @@ my %param = cgi_parameters(query => $q,
                                       mboxstat  => 'no',
                                       mboxmaint => 'no',
                                       archive   => 'no',
+                                      repeatmerged => 'yes',
                                      },
                          );
 # This is craptacular.
@@ -228,6 +229,22 @@ if  ($status{severity} eq 'normal') {
        $showseverity = "Severity: $status{severity};\n";
 }
 
+if (@{$status{found_versions}} or @{$status{fixed_versions}}) {
+     $indexentry.= q(<div style="float:right"><a href=").
+         version_url($status{package},
+                     $status{found_versions},
+                     $status{fixed_versions},
+                    ).
+         q("><img src=").
+         version_url($status{package},
+                     $status{found_versions},
+                     $status{fixed_versions},
+                     2,
+                     2,
+                    ).qq{"></a></div>};
+}
+
+
 $indexentry .= "<div class=\"msgreceived\">\n";
 $indexentry .= htmlize_packagelinks($status{package}, 0) . ";\n";
 
@@ -280,7 +297,6 @@ if (@{$status{found_versions}}) {
     $foundtext .= join ', ', map html_escape($_), @{$status{found_versions}};
     push @descstates, $foundtext;
 }
-
 if (@{$status{fixed_versions}}) {
     my $fixedtext = '<strong>Fixed</strong> in ';
     $fixedtext .= (@{$status{fixed_versions}} == 1) ? 'version ' : 'versions ';
@@ -289,15 +305,21 @@ if (@{$status{fixed_versions}}) {
        $fixedtext .= ' by ' . html_escape(decode_rfc1522($status{done}));
     }
     push @descstates, $fixedtext;
-    push @descstates, '<a href="'.
-        version_url($status{package},
-                    $status{found_versions},
-                    $status{fixed_versions},
-                   ).qq{">Version Graph</a>};
+}
 
-} elsif (length($status{done})) {
+if (@{$status{found_versions}} or @{$status{fixed_versions}}) {
+     push @descstates, '<a href="'.
+         version_url($status{package},
+                     $status{found_versions},
+                     $status{fixed_versions},
+                    ).qq{">Version Graph</a>};
+}
+
+if (length($status{done})) {
     push @descstates, "<strong>Done:</strong> ".html_escape(decode_rfc1522($status{done}));
-} elsif (length($status{forwarded})) {
+}
+
+if (length($status{forwarded})) {
     push @descstates, "<strong>Forwarded</strong> to ".maybelink($status{forwarded});
 }
 
@@ -305,7 +327,7 @@ if (@{$status{fixed_versions}}) {
 my @blockedby= split(/ /, $status{blockedby});
 if (@blockedby && $status{"pending"} ne 'fixed' && ! length($status{done})) {
     for my $b (@blockedby) {
-        my %s = %{getbugstatus($b)};
+        my %s = %{get_bug_status($b)};
         next if $s{"pending"} eq 'fixed' || length $s{done};
         push @descstates, "Fix blocked by <a href=\"" . bug_url($b) . "\">#$b</a>: ".html_escape($s{subject});
     }
@@ -314,7 +336,7 @@ if (@blockedby && $status{"pending"} ne 'fixed' && ! length($status{done})) {
 my @blocks= split(/ /, $status{blocks});
 if (@blocks && $status{"pending"} ne 'fixed' && ! length($status{done})) {
     for my $b (@blocks) {
-        my %s = %{getbugstatus($b)};
+        my %s = %{get_bug_status($b)};
         next if $s{"pending"} eq 'fixed' || length $s{done};
         push @descstates, "Blocking fix for <a href=\"" . bug_url($b) . "\">#$b</a>: ".html_escape($s{subject});
     }
@@ -404,7 +426,7 @@ sub handle_record{
          # Add links to merged bugs
          $output =~ s{(?<=Merged )([\d\s]+)(?=\.)}{join(' ',map {bug_links($_)} (split /\s+/, $1))}eo;
          # Add links to blocked bugs
-         $output =~ s{(?<=Blocking bugs)(?:(of )(\d+))?( (?:added|set to|removed):\s+)([\d\s\,]+)}
+         $output =~ s{(?<=Blocking bugs)(?:( of )(\d+))?( (?:added|set to|removed):\s+)([\d\s\,]+)}
                      {(defined $2?$1.bug_links($2):'').$3.
                            join(' ',map {bug_links($_)} (split /\,?\s+/, $4))}eo;
          # Add links to reassigned packages
@@ -423,8 +445,8 @@ sub handle_record{
          elsif (defined $msg_id) {
               $$seen_msg_ids{$msg_id} = 1;
          }
-         $output .= qq(<hr><a name="$msg_number"></a>\n);
-         $output .= 'View this message in <a href="' . bugurl($ref, "msg=$msg_number", "mbox") . '">rfc822 format</a>';
+         $output .= qq(<hr><p class="msgreceived"><a name="$msg_number"></a>\n);
+         $output .= 'View this message in <a href="' . bug_url($ref, msg=>$msg_number, mbox=>'yes') . '">rfc822 format</a></p>';
          $output .= handle_email_message($record->{text},
                                    ref        => $bug_number,
                                    msg_number => $msg_number,
@@ -515,9 +537,9 @@ END
          my ($msg_id) = $record->{text} =~ /^Message-Id:\s+<(.+)>/im;
          next if exists $seen_message_ids{$msg_id};
          $seen_message_ids{$msg_id} = 1;
-         next if $msg_id =~/handler\..+\.ack(?:info)?\@/;
-         $record_wanted_anyway = 1 if $record->{text} =~ /^Received: \(at control\)/;
-         next if not $boring and $record->{type} ne $wanted_type and not $record_wanted_anyway and @records > 1;
+         next if $msg_id =~/handler\..+\.ack(?:info|done)?\@/;
+         $record_wanted_anyway = 1 if $record->{text} =~ /^Received: \(at control|submit\)/;
+         next if not $boring and not $record->{type} eq $wanted_type and not $record_wanted_anyway and @records > 1;
          my @lines = split( "\n", $record->{text}, -1 );
          if ( $lines[ 1 ] =~ m/^From / ) {
               my $tmp = $lines[ 0 ];