From 3535f6d1e21c5859f381db74a1c69a77e9b876f8 Mon Sep 17 00:00:00 2001 From: "gerv%gerv.net" <> Date: Fri, 8 Nov 2002 16:04:58 +0000 Subject: Bug 71794 - processmail shouldn't bother checking dependencies unless state changes. Patch by gerv; r=myk. --- process_bug.cgi | 46 ++++++++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 16 deletions(-) (limited to 'process_bug.cgi') diff --git a/process_bug.cgi b/process_bug.cgi index bcc5dd2c7..deb6ea80b 100755 --- a/process_bug.cgi +++ b/process_bug.cgi @@ -1309,6 +1309,10 @@ foreach my $id (@idlist) { } } + # We need to run processmail for dependson/blocked bugs if the dependencies + # change or the status or resolution change. This var keeps track of that. + my $check_dep_bugs = 0; + if (defined $::FORM{'dependson'}) { my $me = "blocked"; my $target = "dependson"; @@ -1353,6 +1357,7 @@ foreach my $id (@idlist) { LogDependencyActivity($k, $snapshot{$k}, $me, $target); } LogDependencyActivity($id, $oldsnap, $target, $me); + $check_dep_bugs = 1; } my $tmp = $me; @@ -1444,7 +1449,7 @@ foreach my $id (@idlist) { # my $origOwner = ""; my $origQaContact = ""; - + foreach my $c (@::log_columns) { my $col = $c; # We modify it, don't want to modify array # values in place. @@ -1491,6 +1496,13 @@ foreach my $id (@idlist) { RemoveVotes($id, 0, "This bug has been moved to a different product"); } + + if ($col eq 'bug_status' + && IsOpenedState($old) ne IsOpenedState($new)) + { + $check_dep_bugs = 1; + } + LogActivityEntry($id,$col,$old,$new,$whoid,$timestamp); $bug_changed = 1; } @@ -1568,22 +1580,24 @@ foreach my $id (@idlist) { || ThrowTemplateError($template->error()); } - foreach my $k (keys(%dependencychanged)) { - $vars->{'mail'} = ""; - open(PMAIL, "-|") or exec('./processmail', $k, $::COOKIE{'Bugzilla_login'}); - $vars->{'mail'} .= $_ while ; - close(PMAIL); - - $vars->{'id'} = $k; - $vars->{'type'} = "dep"; - - # Let the user know we checked to see if we should email notice - # of this change to users with a relationship to the dependent - # bug and who did and didn't receive email about it. - $template->process("bug/process/results.html.tmpl", $vars) - || ThrowTemplateError($template->error()); + if ($check_dep_bugs) { + foreach my $k (keys(%dependencychanged)) { + $vars->{'mail'} = ""; + open(PMAIL, "-|") + or exec('./processmail', $k, $::COOKIE{'Bugzilla_login'}); + $vars->{'mail'} .= $_ while ; + close(PMAIL); + + $vars->{'id'} = $k; + $vars->{'type'} = "dep"; + + # Let the user know we checked to see if we should email notice + # of this change to users with a relationship to the dependent + # bug and who did and didn't receive email about it. + $template->process("bug/process/results.html.tmpl", $vars) + || ThrowTemplateError($template->error()); + } } - } # Show next bug, if it exists. -- cgit v1.2.3-24-g4f1b