1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-10 00:42:40 +01:00

Realign "arc land" closed/published warning around more modern language

Summary: Ref T13546. The modern constant from the modern API method for this state is "published", and this more narrowly covers the desired behavior (notably, excluding "Abandoned" revisions).

Test Plan: Ran "arc land ... --revision X" where "X" is a published revision, got an appropriate prompt.

Maniphest Tasks: T13546

Differential Revision: https://secure.phabricator.com/D21345
This commit is contained in:
epriestley 2020-06-10 09:14:59 -07:00
parent 3cad824e38
commit 705c48effc
3 changed files with 15 additions and 15 deletions

View file

@ -333,13 +333,13 @@ abstract class ArcanistLandEngine
} }
$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;
} }
@ -389,28 +389,28 @@ abstract class ArcanistLandEngine
// 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();
} }

View file

@ -86,9 +86,9 @@ final class ArcanistRevisionRef
return ($status === 'abandoned'); return ($status === 'abandoned');
} }
public function isStatusClosed() { public function isStatusPublished() {
$status = $this->getStatus(); $status = $this->getStatus();
return ($status === 'closed'); return ($status === 'published');
} }
public function isStatusAccepted() { public function isStatusAccepted() {

View file

@ -259,10 +259,10 @@ EOTEXT
->setDescription( ->setDescription(
pht( pht(
'Confirms that revisions with changes planned should land.')), 'Confirms that revisions with changes planned should land.')),
$this->newPrompt('arc.land.closed') $this->newPrompt('arc.land.published')
->setDescription( ->setDescription(
pht( pht(
'Confirms that revisions that are already closed should land.')), 'Confirms that revisions that are already published should land.')),
$this->newPrompt('arc.land.not-accepted') $this->newPrompt('arc.land.not-accepted')
->setDescription( ->setDescription(
pht( pht(