1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-09-19 16:38:51 +02: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();
$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();
}

View file

@ -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() {

View file

@ -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(