Skip to content

Commit

Permalink
[backend] do not add new state history elements when the review state…
Browse files Browse the repository at this point in the history
… is not changing (but gets new comment)
  • Loading branch information
adrianschroeter committed Dec 22, 2011
1 parent 51ecd93 commit 2a5b581
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/backend/bs_srcserver
Expand Up @@ -5845,13 +5845,18 @@ sub postrequest {
# # FIXME3.0: think about review ordering and make reviews addressable
if ($matching && !($rkeyseen{$rkey} && $r->{'state'} eq 'accepted')) {
$rkeyseen{$rkey} = 1;
$r->{'state'} = $cgi->{'newstate'};
$found = 1;
$r->{'when'} = $mytime;
$r->{'who'} = $cgi->{'user'} if defined $cgi->{'user'};
$r->{'comment'} = $cgi->{'comment'} if defined($cgi->{'comment'});
$found = 1;
$go_new_state = 'new' if $go_new_state eq "review" && $r->{'state'} eq 'accepted';
$go_new_state = $r->{'state'} if $go_new_state eq "review" and $r->{'state'} ne 'new'; # take decline
if ($r->{'state'} ne $cgi->{'newstate'} || $r->{'who'} ne $cgi->{'user'}){
$r->{'state'} = $cgi->{'newstate'};
$r->{'who'} = $cgi->{'user'};
$go_new_state = 'new' if $go_new_state eq "review" && $r->{'state'} eq 'accepted';
$go_new_state = $r->{'state'} if $go_new_state eq "review" and $r->{'state'} ne 'new'; # take decline
} else {
# no new history entry
$go_new_state = '';
}
} else {
# don't touch the request state if a review is still open, except the
# review got declined or superseded or reopened.
Expand Down

0 comments on commit 2a5b581

Please sign in to comment.