From 705c48effcb521b88c13173b1ac8b10455162b72 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 10 Jun 2020 09:14:59 -0700 Subject: [PATCH] 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 --- src/land/engine/ArcanistLandEngine.php | 22 +++++++++++----------- src/ref/revision/ArcanistRevisionRef.php | 4 ++-- src/workflow/ArcanistLandWorkflow.php | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/land/engine/ArcanistLandEngine.php b/src/land/engine/ArcanistLandEngine.php index 31e51976..9dc7eb50 100644 --- a/src/land/engine/ArcanistLandEngine.php +++ b/src/land/engine/ArcanistLandEngine.php @@ -333,13 +333,13 @@ abstract class ArcanistLandEngine } $planned = array(); - $closed = array(); + $published = array(); $not_accepted = array(); foreach ($revision_refs as $revision_ref) { if ($revision_ref->isStatusChangesPlanned()) { $planned[] = $revision_ref; - } else if ($revision_ref->isStatusClosed()) { - $closed[] = $revision_ref; + } else if ($revision_ref->isStatusPublished()) { + $published[] = $revision_ref; } else if (!$revision_ref->isStatusAccepted()) { $not_accepted[] = $revision_ref; } @@ -389,28 +389,28 @@ abstract class ArcanistLandEngine // See PHI1727. Previously, this prompt was bundled with the generic // "not accepted" prompt, but at least one user found it confusing. - if ($closed) { - $example_ref = head($closed); + if ($published) { + $example_ref = head($published); echo tsprintf( "\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( 'You are landing %s revision(s) which are already in the state '. '"%s", indicating that they have previously landed:', - phutil_count($closed), + phutil_count($published), $example_ref->getStatusDisplayName())); - foreach ($closed as $revision_ref) { + foreach ($published as $revision_ref) { echo tsprintf('%s', $revision_ref->newDisplayRef()); } $query = pht( - 'Land %s revision(s) that are already closed?', - phutil_count($closed)); + 'Land %s revision(s) that are already published?', + phutil_count($published)); $this->getWorkflow() - ->getPrompt('arc.land.closed') + ->getPrompt('arc.land.published') ->setQuery($query) ->execute(); } diff --git a/src/ref/revision/ArcanistRevisionRef.php b/src/ref/revision/ArcanistRevisionRef.php index 9ec2fb87..c507baa4 100644 --- a/src/ref/revision/ArcanistRevisionRef.php +++ b/src/ref/revision/ArcanistRevisionRef.php @@ -86,9 +86,9 @@ final class ArcanistRevisionRef return ($status === 'abandoned'); } - public function isStatusClosed() { + public function isStatusPublished() { $status = $this->getStatus(); - return ($status === 'closed'); + return ($status === 'published'); } public function isStatusAccepted() { diff --git a/src/workflow/ArcanistLandWorkflow.php b/src/workflow/ArcanistLandWorkflow.php index d34dc15e..8a6f9f17 100644 --- a/src/workflow/ArcanistLandWorkflow.php +++ b/src/workflow/ArcanistLandWorkflow.php @@ -259,10 +259,10 @@ EOTEXT ->setDescription( pht( 'Confirms that revisions with changes planned should land.')), - $this->newPrompt('arc.land.closed') + $this->newPrompt('arc.land.published') ->setDescription( 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') ->setDescription( pht(