@@ -28,8 +28,6 @@ use strict;
28
28
use lib qw( .) ;
29
29
require " CGI.pl" ;
30
30
31
- # Shut up misguided -w warnings about "used only once":
32
-
33
31
use vars %::FORM ;
34
32
35
33
ConnectToDatabase();
@@ -63,6 +61,9 @@ if ($hide_resolved !~ /^\d+$/ || $hide_resolved != 1) { $hide_resolved = 0 };
63
61
# A hash to count visited bugs, and also to avoid processing repeated bugs
64
62
my %seen ;
65
63
64
+ # A hash to keep track of the bugs we print for the 'as buglist' links.
65
+ my %printed ;
66
+
66
67
# HTML output generated in the parse of the dependency tree. This is a
67
68
# global only to avoid excessive complication in the recursion invocation
68
69
my $html ;
@@ -92,6 +93,7 @@ my $scriptname = $::ENV{'SCRIPT_NAME'}; # showdependencytree.cgi
92
93
# html: Bug descriptions are appended here
93
94
# realdepth: We set the maximum depth of recursion reached
94
95
# seen: We store the bugs analyzed so far
96
+ # printed: We store those bugs we actually print, for the "buglist" link
95
97
# Globals Referenced
96
98
# maxdepth
97
99
# hide_resolved
@@ -161,6 +163,8 @@ sub DumpKids {
161
163
$short_desc .</a>\n | ;
162
164
}
163
165
if (! $opened ) { $html .= " </span></strike>" ; }
166
+
167
+ $printed {$kid } = 1;
164
168
} # End hideable output
165
169
166
170
# Store the maximum depth so far
@@ -197,6 +201,7 @@ sub makeTreeHTML {
197
201
# Clean up globals for this run
198
202
$html = " " ;
199
203
%seen = ();
204
+ %printed = ();
200
205
201
206
DumpKids($i , $target );
202
207
my $tmphtml = $html ;
@@ -205,6 +210,11 @@ sub makeTreeHTML {
205
210
$html = " <h3>Bugs that bug $linked_id " .($target eq " blocked" ?
206
211
" blocks" : " depends on" );
207
212
213
+ if ((scalar keys %printed ) > 0) {
214
+ $html .= ' (<a href="buglist.cgi?bug_id=' . join (' ,' , keys %printed ) .
215
+ ' ">view as bug list</a>)' ;
216
+ }
217
+
208
218
# Provide feedback for omitted bugs
209
219
if ($maxdepth || $hide_resolved ) {
210
220
$html .= " <small><b>(Only " ;
@@ -218,7 +228,7 @@ sub makeTreeHTML {
218
228
$html .= $tmphtml ;
219
229
220
230
# If no bugs were found, say so
221
- if ((scalar keys %seen ) < 2 ) {
231
+ if ((scalar keys %printed ) == 0 ) {
222
232
$html .= " None<p>\n " ;
223
233
}
224
234
@@ -296,7 +306,7 @@ sub drawDepForm {
296
306
<form method="get" action="$scriptname "
297
307
style="display: inline; margin: 0px;">
298
308
299
- <!-- Limit entry form: the button can't do anything when total depth
309
+ <!-- Limit entry form: the button can not do anything when total depth
300
310
is less than two, so disable it -->
301
311
<input name="maxdepth" size="4" maxlength="4" value="|
302
312
. ( $maxdepth > 0 ? $maxdepth : " " ) . qq| ">
0 commit comments