Differential D18490 Diff 44417 src/applications/differential/xaction/DifferentialRevisionCloseTransaction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/xaction/DifferentialRevisionCloseTransaction.php
| Show All 40 Lines | public function applyInternalEffects($object, $value) { | ||||
| $object->setModernRevisionStatus($status_published); | $object->setModernRevisionStatus($status_published); | ||||
| $object->setProperty( | $object->setProperty( | ||||
| DifferentialRevision::PROPERTY_CLOSED_FROM_ACCEPTED, | DifferentialRevision::PROPERTY_CLOSED_FROM_ACCEPTED, | ||||
| $was_accepted); | $was_accepted); | ||||
| } | } | ||||
| protected function validateAction($object, PhabricatorUser $viewer) { | protected function validateAction($object, PhabricatorUser $viewer) { | ||||
| if ($this->hasEditor()) { | |||||
| if ($this->getEditor()->getIsCloseByCommit()) { | if ($this->getEditor()->getIsCloseByCommit()) { | ||||
| // If we're closing a revision because we discovered a commit, we don't | // If we're closing a revision because we discovered a commit, we don't | ||||
| // care what state it was in. | // care what state it was in. | ||||
| return; | return; | ||||
| } | } | ||||
| } | |||||
| if ($object->isClosed()) { | if ($object->isClosed()) { | ||||
| throw new Exception( | throw new Exception( | ||||
| pht( | pht( | ||||
| 'You can not close this revision because it has already been '. | 'You can not close this revision because it has already been '. | ||||
| 'closed. Only open revisions can be closed.')); | 'closed. Only open revisions can be closed.')); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 75 Lines • Show Last 20 Lines | |||||