mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 05:50:55 +01:00
Allow "arc diff --draft" to create revisions as drafts more forcefully
Summary: Depends on D18771. See PHI206. Currently, `arc diff --draft` only holds revisions in draft mode: it doesn't put them into draft mode if the install isn't configured to use draft mode. Instead, make it a bit more forceful so that `arc diff --draft` can create into draft mode explicitly even if protoypes are off. This aligns with expection a little more clearly. Test Plan: Ran `arc diff --draft` with prototypes off, got a revision held in draft mode. Reviewers: amckinley Reviewed By: amckinley Differential Revision: https://secure.phabricator.com/D18772
This commit is contained in:
parent
314e7266c3
commit
95a5b41b0b
1 changed files with 9 additions and 0 deletions
|
@ -16,6 +16,15 @@ final class DifferentialRevisionHoldDraftTransaction
|
|||
|
||||
public function applyInternalEffects($object, $value) {
|
||||
$object->setHoldAsDraft($value);
|
||||
|
||||
// If draft isn't the default state but we're creating a new revision
|
||||
// and holding it as a draft, put it in draft mode. See PHI206.
|
||||
// TODO: This can probably be removed once Draft is the universal default.
|
||||
if ($this->isNewObject()) {
|
||||
if ($object->isNeedsReview()) {
|
||||
$object->setModernRevisionStatus(DifferentialRevisionStatus::DRAFT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getTitle() {
|
||||
|
|
Loading…
Reference in a new issue