Differential D18819 Diff 45159 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 1,582 Lines • ▼ Show 20 Lines | if ($object->isDraft() && $auto_undraft) { | ||||
if (phid_get_type($acting_phid) != $user_type) { | if (phid_get_type($acting_phid) != $user_type) { | ||||
$this->setActingAsPHID($author_phid); | $this->setActingAsPHID($author_phid); | ||||
} | } | ||||
$xaction = $object->getApplicationTransactionTemplate() | $xaction = $object->getApplicationTransactionTemplate() | ||||
->setAuthorPHID($author_phid) | ->setAuthorPHID($author_phid) | ||||
->setTransactionType( | ->setTransactionType( | ||||
DifferentialRevisionRequestReviewTransaction::TRANSACTIONTYPE) | DifferentialRevisionRequestReviewTransaction::TRANSACTIONTYPE) | ||||
->setOldValue(false) | |||||
->setNewValue(true); | ->setNewValue(true); | ||||
$xaction = $this->populateTransaction($object, $xaction); | |||||
// If we're creating this revision and immediately moving it out of | // If we're creating this revision and immediately moving it out of | ||||
// the draft state, mark this as a create transaction so it gets | // the draft state, mark this as a create transaction so it gets | ||||
// hidden in the timeline and mail, since it isn't interesting: it | // hidden in the timeline and mail, since it isn't interesting: it | ||||
// is as though the draft phase never happened. | // is as though the draft phase never happened. | ||||
if ($this->getIsNewObject()) { | if ($this->getIsNewObject()) { | ||||
$xaction->setIsCreateTransaction(true); | $xaction->setIsCreateTransaction(true); | ||||
} | } | ||||
$object->openTransaction(); | // Queue this transaction and apply it separately after the current | ||||
$object | // batch of transactions finishes so that Herald can fire on the new | ||||
->setStatus(DifferentialRevisionStatus::NEEDS_REVIEW) | // revision state. See T13027 for discussion. | ||||
->save(); | $this->queueTransaction($xaction); | ||||
$xaction->save(); | |||||
$object->saveTransaction(); | |||||
$xactions[] = $xaction; | |||||
} | } | ||||
} | } | ||||
// If the revision is new or was a draft, and is no longer a draft, we | // If the revision is new or was a draft, and is no longer a draft, we | ||||
// might be sending the first email about it. | // might be sending the first email about it. | ||||
// This might mean it was created directly into a non-draft state, or | // This might mean it was created directly into a non-draft state, or | ||||
// it just automatically undrafted after builds finished, or a user | // it just automatically undrafted after builds finished, or a user | ||||
Show All 37 Lines |