mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 12:00:55 +01:00
Add a "--force" flag to "bin/repository move-paths"
Summary: Ref T7148. The automated export process runs this via daemon, which can't answer "Y" to this prompt. Let it "--force" instead. (Some of my test instances didn't have any repositories, which is why I didn't catch this sooner.) Test Plan: Ran `bin/repository move-paths --force ...`, saw change applied without a prompt. Reviewers: chad Reviewed By: chad Maniphest Tasks: T7148 Differential Revision: https://secure.phabricator.com/D16426
This commit is contained in:
parent
56bc84a73b
commit
fcb20cb799
1 changed files with 7 additions and 1 deletions
|
@ -19,6 +19,10 @@ final class PhabricatorRepositoryManagementMovePathsWorkflow
|
|||
'param' => 'prefix',
|
||||
'help' => pht('Replace matching prefixes with this string.'),
|
||||
),
|
||||
array(
|
||||
'name' => 'force',
|
||||
'help' => pht('Apply changes without prompting.'),
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -47,6 +51,8 @@ final class PhabricatorRepositoryManagementMovePathsWorkflow
|
|||
'You must specify a path prefix to move to with --to.'));
|
||||
}
|
||||
|
||||
$is_force = $args->getArg('force');
|
||||
|
||||
$rows = array();
|
||||
|
||||
$any_changes = false;
|
||||
|
@ -118,7 +124,7 @@ final class PhabricatorRepositoryManagementMovePathsWorkflow
|
|||
}
|
||||
|
||||
$prompt = pht('Apply these changes?');
|
||||
if (!phutil_console_confirm($prompt)) {
|
||||
if (!$is_force && !phutil_console_confirm($prompt)) {
|
||||
throw new Exception(pht('Declining to apply changes.'));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue