mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 12:00:55 +01:00
Default new reviewers to "added", and don't overwrite reviewer states when updating
Summary: Fixes two issues with Differential: - New reviewers on initial diff were being created into a `null` state. - The `"="` edge update was overwriting accepted/rejected statuses. This could maybe be more nuanced in the long run, but I've just made it update correctly for now. Test Plan: - Created and updated a revision, paying attention to reviewer statuses. Reviewers: btrahan Reviewed By: btrahan Subscribers: aran, epriestley Differential Revision: https://secure.phabricator.com/D8494
This commit is contained in:
parent
ad88ff28a1
commit
0b6c0c135f
1 changed files with 13 additions and 1 deletions
|
@ -152,10 +152,22 @@ final class DifferentialReviewersField
|
|||
}
|
||||
|
||||
public function readValueFromCommitMessage($value) {
|
||||
$current_reviewers = $this->getObject()->getReviewerStatus();
|
||||
$current_reviewers = mpull($current_reviewers, null, 'getReviewerPHID');
|
||||
|
||||
$reviewers = array();
|
||||
foreach ($value as $phid) {
|
||||
$reviewers[] = new DifferentialReviewer($phid, array());
|
||||
$reviewer = idx($current_reviewers, $phid);
|
||||
if ($reviewer) {
|
||||
$reviewers[] = $reviewer;
|
||||
} else {
|
||||
$data = array(
|
||||
'status' => DifferentialReviewerStatus::STATUS_ADDED,
|
||||
);
|
||||
$reviewers[] = new DifferentialReviewer($phid, $data);
|
||||
}
|
||||
}
|
||||
|
||||
$this->setValue($reviewers);
|
||||
|
||||
return $this;
|
||||
|
|
Loading…
Reference in a new issue