Commit 3535f6d1 authored by gerv%gerv.net's avatar gerv%gerv.net

Bug 71794 - processmail shouldn't bother checking dependencies unless state…

Bug 71794 - processmail shouldn't bother checking dependencies unless state changes. Patch by gerv; r=myk.
parent 5f52ea9a
...@@ -1309,6 +1309,10 @@ foreach my $id (@idlist) { ...@@ -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'}) { if (defined $::FORM{'dependson'}) {
my $me = "blocked"; my $me = "blocked";
my $target = "dependson"; my $target = "dependson";
...@@ -1353,6 +1357,7 @@ foreach my $id (@idlist) { ...@@ -1353,6 +1357,7 @@ foreach my $id (@idlist) {
LogDependencyActivity($k, $snapshot{$k}, $me, $target); LogDependencyActivity($k, $snapshot{$k}, $me, $target);
} }
LogDependencyActivity($id, $oldsnap, $target, $me); LogDependencyActivity($id, $oldsnap, $target, $me);
$check_dep_bugs = 1;
} }
my $tmp = $me; my $tmp = $me;
...@@ -1491,6 +1496,13 @@ foreach my $id (@idlist) { ...@@ -1491,6 +1496,13 @@ foreach my $id (@idlist) {
RemoveVotes($id, 0, RemoveVotes($id, 0,
"This bug has been moved to a different product"); "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); LogActivityEntry($id,$col,$old,$new,$whoid,$timestamp);
$bug_changed = 1; $bug_changed = 1;
} }
...@@ -1568,9 +1580,11 @@ foreach my $id (@idlist) { ...@@ -1568,9 +1580,11 @@ foreach my $id (@idlist) {
|| ThrowTemplateError($template->error()); || ThrowTemplateError($template->error());
} }
if ($check_dep_bugs) {
foreach my $k (keys(%dependencychanged)) { foreach my $k (keys(%dependencychanged)) {
$vars->{'mail'} = ""; $vars->{'mail'} = "";
open(PMAIL, "-|") or exec('./processmail', $k, $::COOKIE{'Bugzilla_login'}); open(PMAIL, "-|")
or exec('./processmail', $k, $::COOKIE{'Bugzilla_login'});
$vars->{'mail'} .= $_ while <PMAIL>; $vars->{'mail'} .= $_ while <PMAIL>;
close(PMAIL); close(PMAIL);
...@@ -1583,7 +1597,7 @@ foreach my $id (@idlist) { ...@@ -1583,7 +1597,7 @@ foreach my $id (@idlist) {
$template->process("bug/process/results.html.tmpl", $vars) $template->process("bug/process/results.html.tmpl", $vars)
|| ThrowTemplateError($template->error()); || ThrowTemplateError($template->error());
} }
}
} }
# Show next bug, if it exists. # Show next bug, if it exists.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment