Differential D20565 Diff 49063 src/applications/differential/xaction/DifferentialRevisionCloseTransaction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/xaction/DifferentialRevisionCloseTransaction.php
Show All 38 Lines | public function applyInternalEffects($object, $value) { | ||||
$was_accepted = $object->isAccepted(); | $was_accepted = $object->isAccepted(); | ||||
$status_published = DifferentialRevisionStatus::PUBLISHED; | $status_published = DifferentialRevisionStatus::PUBLISHED; | ||||
$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); | ||||
// See T13300. When a revision is closed, we promote it out of "Draft" | |||||
// immediately. This usually happens when a user creates a draft revision | |||||
// and then lands the associated commit before the revision leaves draft. | |||||
$object->setShouldBroadcast(true); | |||||
} | } | ||||
protected function validateAction($object, PhabricatorUser $viewer) { | protected function validateAction($object, PhabricatorUser $viewer) { | ||||
if ($this->hasEditor()) { | 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; | ||||
▲ Show 20 Lines • Show All 104 Lines • Show Last 20 Lines |