Differential D18419 Diff 44263 src/applications/differential/editor/DifferentialTransactionEditor.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/editor/DifferentialTransactionEditor.php
| Show First 20 Lines • Show All 529 Lines • ▼ Show 20 Lines | if ($has_accepting_user && | ||||
| // reviewer resigns or is removed. | // reviewer resigns or is removed. | ||||
| $new_status = DifferentialRevisionStatus::NEEDS_REVIEW; | $new_status = DifferentialRevisionStatus::NEEDS_REVIEW; | ||||
| } | } | ||||
| if ($new_status === null) { | if ($new_status === null) { | ||||
| return $xactions; | return $xactions; | ||||
| } | } | ||||
| $old_legacy_status = $revision->getLegacyRevisionStatus(); | $old_status = $revision->getModernRevisionStatus(); | ||||
| $revision->setModernRevisionStatus($new_status); | if ($new_status == $old_status) { | ||||
| $new_legacy_status = $revision->getLegacyRevisionStatus(); | |||||
| if ($new_legacy_status == $old_legacy_status) { | |||||
| return $xactions; | return $xactions; | ||||
| } | } | ||||
| $xaction = id(new DifferentialTransaction()) | $xaction = id(new DifferentialTransaction()) | ||||
| ->setTransactionType( | ->setTransactionType( | ||||
| DifferentialRevisionStatusTransaction::TRANSACTIONTYPE) | DifferentialRevisionStatusTransaction::TRANSACTIONTYPE) | ||||
| ->setOldValue($old_legacy_status) | ->setOldValue($old_status) | ||||
| ->setNewValue($new_legacy_status); | ->setNewValue($new_status); | ||||
| $xaction = $this->populateTransaction($revision, $xaction) | $xaction = $this->populateTransaction($revision, $xaction) | ||||
| ->save(); | ->save(); | ||||
| $xactions[] = $xaction; | $xactions[] = $xaction; | ||||
| // Save the status adjustment we made earlier. | // Save the status adjustment we made earlier. | ||||
| // TODO: This can be a little cleaner and more obvious once storage | $revision | ||||
| // migrates. | ->setModernRevisionStatus($new_status) | ||||
| $revision->save(); | ->save(); | ||||
| return $xactions; | return $xactions; | ||||
| } | } | ||||
| protected function validateTransaction( | protected function validateTransaction( | ||||
| PhabricatorLiskDAO $object, | PhabricatorLiskDAO $object, | ||||
| $type, | $type, | ||||
| ▲ Show 20 Lines • Show All 940 Lines • Show Last 20 Lines | |||||