Changeset View
Changeset View
Standalone View
Standalone View
src/land/engine/ArcanistLandEngine.php
| Show First 20 Lines • Show All 327 Lines • ▼ Show 20 Lines | if ($unauthored) { | ||||
| $this->getWorkflow() | $this->getWorkflow() | ||||
| ->getPrompt('arc.land.unauthored') | ->getPrompt('arc.land.unauthored') | ||||
| ->setQuery($query) | ->setQuery($query) | ||||
| ->execute(); | ->execute(); | ||||
| } | } | ||||
| $planned = array(); | $planned = array(); | ||||
| $closed = array(); | $published = array(); | ||||
| $not_accepted = array(); | $not_accepted = array(); | ||||
| foreach ($revision_refs as $revision_ref) { | foreach ($revision_refs as $revision_ref) { | ||||
| if ($revision_ref->isStatusChangesPlanned()) { | if ($revision_ref->isStatusChangesPlanned()) { | ||||
| $planned[] = $revision_ref; | $planned[] = $revision_ref; | ||||
| } else if ($revision_ref->isStatusClosed()) { | } else if ($revision_ref->isStatusPublished()) { | ||||
| $closed[] = $revision_ref; | $published[] = $revision_ref; | ||||
| } else if (!$revision_ref->isStatusAccepted()) { | } else if (!$revision_ref->isStatusAccepted()) { | ||||
| $not_accepted[] = $revision_ref; | $not_accepted[] = $revision_ref; | ||||
| } | } | ||||
| } | } | ||||
| // See T10233. Previously, this prompt was bundled with the generic "not | // See T10233. Previously, this prompt was bundled with the generic "not | ||||
| // accepted" prompt, but users found it confusing and interpreted the | // accepted" prompt, but users found it confusing and interpreted the | ||||
| // prompt as a bug. | // prompt as a bug. | ||||
| Show All 33 Lines | if ($planned) { | ||||
| ->getPrompt('arc.land.changes-planned') | ->getPrompt('arc.land.changes-planned') | ||||
| ->setQuery($query) | ->setQuery($query) | ||||
| ->execute(); | ->execute(); | ||||
| } | } | ||||
| // See PHI1727. Previously, this prompt was bundled with the generic | // See PHI1727. Previously, this prompt was bundled with the generic | ||||
| // "not accepted" prompt, but at least one user found it confusing. | // "not accepted" prompt, but at least one user found it confusing. | ||||
| if ($closed) { | if ($published) { | ||||
| $example_ref = head($closed); | $example_ref = head($published); | ||||
| echo tsprintf( | echo tsprintf( | ||||
| "\n%!\n%W\n\n", | "\n%!\n%W\n\n", | ||||
| pht('%s REVISION(S) ARE ALREADY CLOSED', phutil_count($closed)), | pht('%s REVISION(S) ARE ALREADY PUBLISHED', phutil_count($published)), | ||||
| pht( | pht( | ||||
| 'You are landing %s revision(s) which are already in the state '. | 'You are landing %s revision(s) which are already in the state '. | ||||
| '"%s", indicating that they have previously landed:', | '"%s", indicating that they have previously landed:', | ||||
| phutil_count($closed), | phutil_count($published), | ||||
| $example_ref->getStatusDisplayName())); | $example_ref->getStatusDisplayName())); | ||||
| foreach ($closed as $revision_ref) { | foreach ($published as $revision_ref) { | ||||
| echo tsprintf('%s', $revision_ref->newDisplayRef()); | echo tsprintf('%s', $revision_ref->newDisplayRef()); | ||||
| } | } | ||||
| $query = pht( | $query = pht( | ||||
| 'Land %s revision(s) that are already closed?', | 'Land %s revision(s) that are already published?', | ||||
| phutil_count($closed)); | phutil_count($published)); | ||||
| $this->getWorkflow() | $this->getWorkflow() | ||||
| ->getPrompt('arc.land.closed') | ->getPrompt('arc.land.published') | ||||
| ->setQuery($query) | ->setQuery($query) | ||||
| ->execute(); | ->execute(); | ||||
| } | } | ||||
| if ($not_accepted) { | if ($not_accepted) { | ||||
| $example_ref = head($not_accepted); | $example_ref = head($not_accepted); | ||||
| echo tsprintf( | echo tsprintf( | ||||
| ▲ Show 20 Lines • Show All 1,155 Lines • Show Last 20 Lines | |||||