@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+13 -1
+13 -1
src/applications/differential/customfield/DifferentialReviewersField.php
··· 152 152 } 153 153 154 154 public function readValueFromCommitMessage($value) { 155 + $current_reviewers = $this->getObject()->getReviewerStatus(); 156 + $current_reviewers = mpull($current_reviewers, null, 'getReviewerPHID'); 157 + 155 158 $reviewers = array(); 156 159 foreach ($value as $phid) { 157 - $reviewers[] = new DifferentialReviewer($phid, array()); 160 + $reviewer = idx($current_reviewers, $phid); 161 + if ($reviewer) { 162 + $reviewers[] = $reviewer; 163 + } else { 164 + $data = array( 165 + 'status' => DifferentialReviewerStatus::STATUS_ADDED, 166 + ); 167 + $reviewers[] = new DifferentialReviewer($phid, $data); 168 + } 158 169 } 170 + 159 171 $this->setValue($reviewers); 160 172 161 173 return $this;