@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Allow "arc diff --plan-changes" to work with drafts enabled

Summary:
See PHI346. Ref T13054. If you have prototypes enabled on the server but use `master` / `stable` on the client and run `arc diff --plan-changes`, the transition is rejected because "Draft -> Changes Planned" isn't currently a legal transition.

Allow this transition if not coming from the web UI (to keep it out of the dropdown).

Test Plan:
- Ran `arc diff --plan-changes` on `master`, got a "Changes Planned" revision instead of a validation error.
- Ran `arc diff` without `--plan-changes`, got a draft, verified that "Plan Changes" still doesn't appear in the action dropdown.

Maniphest Tasks: T13054

Differential Revision: https://secure.phabricator.com/D19067

+13 -2
+13 -2
src/applications/differential/xaction/DifferentialRevisionPlanChangesTransaction.php
··· 57 57 58 58 protected function validateAction($object, PhabricatorUser $viewer) { 59 59 if ($object->isDraft()) { 60 - throw new Exception( 61 - pht('You can not plan changes to a draft revision.')); 60 + 61 + // See PHI346. Until the "Draft" state fully unprototypes, allow drafts 62 + // to be moved to "changes planned" via the API. This preserves the 63 + // behavior of "arc diff --plan-changes". We still prevent this 64 + // transition from the web UI. 65 + // TODO: Remove this once drafts leave prototype. 66 + 67 + $editor = $this->getEditor(); 68 + $type_web = PhabricatorWebContentSource::SOURCECONST; 69 + if ($editor->getContentSource()->getSource() == $type_web) { 70 + throw new Exception( 71 + pht('You can not plan changes to a draft revision.')); 72 + } 62 73 } 63 74 64 75 if ($object->isChangePlanned()) {