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

Pluralize add files questions

Test Plan: Saw 'Do you want to add these files to the commit?'

Reviewers: epriestley

Reviewed By: epriestley

CC: Korvin, aran

Differential Revision: https://secure.phabricator.com/D6991
This commit is contained in:
Jakub Vrana 2013-09-14 08:06:50 -07:00
parent c00d8c551c
commit bfbb16f322
2 changed files with 20 additions and 6 deletions

View file

@ -85,6 +85,16 @@ PhutilTranslator::getInstance()
'Do you want to mark these files as binary and continue?', 'Do you want to mark these files as binary and continue?',
), ),
'Do you want to amend these files to the commit?' => array(
'Do you want to amend this file to the commit?',
'Do you want to amend these files to the commit?',
),
'Do you want to add these files to the commit?' => array(
'Do you want to add this file to the commit?',
'Do you want to add these files to the commit?',
),
'line(s)' => array('line', 'lines'), 'line(s)' => array('line', 'lines'),
'%d test(s)' => array('%d test', '%d tests'), '%d test(s)' => array('%d test', '%d tests'),

View file

@ -812,7 +812,7 @@ abstract class ArcanistBaseWorkflow extends Phobject {
"may have forgotten to 'hg add' them to your commit.\n"); "may have forgotten to 'hg add' them to your commit.\n");
} }
if ($this->askForAdd()) { if ($this->askForAdd($untracked)) {
$api->addToCommit($untracked); $api->addToCommit($untracked);
$must_commit += array_flip($untracked); $must_commit += array_flip($untracked);
} else if ($this->commitMode == self::COMMIT_DISABLE) { } else if ($this->commitMode == self::COMMIT_DISABLE) {
@ -852,7 +852,7 @@ abstract class ArcanistBaseWorkflow extends Phobject {
$working_copy_desc. $working_copy_desc.
" Unstaged changes in working copy:\n". " Unstaged changes in working copy:\n".
" ".implode("\n ", $unstaged)."\n"; " ".implode("\n ", $unstaged)."\n";
if ($this->askForAdd()) { if ($this->askForAdd($unstaged)) {
$api->addToCommit($unstaged); $api->addToCommit($unstaged);
$must_commit += array_flip($unstaged); $must_commit += array_flip($unstaged);
} else { } else {
@ -882,7 +882,7 @@ abstract class ArcanistBaseWorkflow extends Phobject {
$working_copy_desc. $working_copy_desc.
" Uncommitted changes in working copy:\n". " Uncommitted changes in working copy:\n".
" ".implode("\n ", $uncommitted)."\n"; " ".implode("\n ", $uncommitted)."\n";
if ($this->askForAdd()) { if ($this->askForAdd($uncommitted)) {
$must_commit += array_flip($uncommitted); $must_commit += array_flip($uncommitted);
} else { } else {
throw new ArcanistUncommittedChangesException( throw new ArcanistUncommittedChangesException(
@ -958,7 +958,7 @@ abstract class ArcanistBaseWorkflow extends Phobject {
return false; return false;
} }
private function askForAdd() { private function askForAdd(array $files) {
if ($this->commitMode == self::COMMIT_DISABLE) { if ($this->commitMode == self::COMMIT_DISABLE) {
return false; return false;
} }
@ -969,9 +969,13 @@ abstract class ArcanistBaseWorkflow extends Phobject {
return true; return true;
} }
if ($this->shouldAmend) { if ($this->shouldAmend) {
$prompt = "Do you want to amend these files to the commit?"; $prompt = pht(
'Do you want to amend these files to the commit?',
count($files));
} else { } else {
$prompt = "Do you want to add these files to the commit?"; $prompt = pht(
'Do you want to add these files to the commit?',
count($files));
} }
return phutil_console_confirm($prompt); return phutil_console_confirm($prompt);
} }