1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-09 14:21:02 +01:00

Start revisions in "Draft" if prototypes are enabled

Summary: Ref T2543. This is a less ambitious version of the rule in D18628, which I backed off from, since I think this probably still has a fair number of loose ends to tie up.

Test Plan: Created a revision locally.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T2543

Differential Revision: https://secure.phabricator.com/D18713
This commit is contained in:
epriestley 2017-10-19 13:35:02 -07:00
parent d36f98a15a
commit bfabe49c5a

View file

@ -67,13 +67,19 @@ final class DifferentialRevision extends DifferentialDAO
$view_policy = $app->getPolicy( $view_policy = $app->getPolicy(
DifferentialDefaultViewCapability::CAPABILITY); DifferentialDefaultViewCapability::CAPABILITY);
if (PhabricatorEnv::getEnvConfig('phabricator.show-prototypes')) {
$initial_state = DifferentialRevisionStatus::DRAFT;
} else {
$initial_state = DifferentialRevisionStatus::NEEDS_REVIEW;
}
return id(new DifferentialRevision()) return id(new DifferentialRevision())
->setViewPolicy($view_policy) ->setViewPolicy($view_policy)
->setAuthorPHID($actor->getPHID()) ->setAuthorPHID($actor->getPHID())
->attachRepository(null) ->attachRepository(null)
->attachActiveDiff(null) ->attachActiveDiff(null)
->attachReviewers(array()) ->attachReviewers(array())
->setModernRevisionStatus(DifferentialRevisionStatus::NEEDS_REVIEW); ->setModernRevisionStatus($initial_state);
} }
protected function getConfiguration() { protected function getConfiguration() {