use lib qw(.);
require "CGI.pl";
-# Shut up misguided -w warnings about "used only once":
-
use vars %::FORM;
ConnectToDatabase();
# A hash to count visited bugs, and also to avoid processing repeated bugs
my %seen;
+# A hash to keep track of the bugs we print for the 'as buglist' links.
+my %printed;
+
# HTML output generated in the parse of the dependency tree. This is a
# global only to avoid excessive complication in the recursion invocation
my $html;
# html: Bug descriptions are appended here
# realdepth: We set the maximum depth of recursion reached
# seen: We store the bugs analyzed so far
+# printed: We store those bugs we actually print, for the "buglist" link
# Globals Referenced
# maxdepth
# hide_resolved
$short_desc.</a>\n|;
}
if (! $opened) { $html .= "</span></strike>"; }
+
+ $printed{$kid} = 1;
} # End hideable output
# Store the maximum depth so far
# Clean up globals for this run
$html = "";
%seen = ();
+ %printed = ();
DumpKids($i, $target);
my $tmphtml = $html;
$html = "<h3>Bugs that bug $linked_id ".($target eq "blocked" ?
"blocks" : "depends on");
+ if ((scalar keys %printed) > 0) {
+ $html .= ' (<a href="buglist.cgi?bug_id=' . join(',', keys %printed) .
+ '">view as bug list</a>)';
+ }
+
# Provide feedback for omitted bugs
if ($maxdepth || $hide_resolved) {
$html .= " <small><b>(Only ";
$html .= $tmphtml;
# If no bugs were found, say so
- if ((scalar keys %seen) < 2) {
+ if ((scalar keys %printed) == 0) {
$html .= " None<p>\n";
}
<form method="get" action="$scriptname"
style="display: inline; margin: 0px;">
- <!-- Limit entry form: the button can't do anything when total depth
+ <!-- Limit entry form: the button can not do anything when total depth
is less than two, so disable it -->
<input name="maxdepth" size="4" maxlength="4" value="|
. ( $maxdepth > 0 ? $maxdepth : "" ) . qq|">