mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-22 14:52:40 +01:00
Use phutil_console_confirm() correctly, not vestigal $this->confirm().
Summary: Test Plan: $ arc patch --diff 553961 Patch deletes file 'html/miniprofile.php', but the file does not exist in the working copy. Continue anyway? [y/N] y Patch deletes file 'html/index.php', but the file does not exist in the working copy. Continue anyway? [y/N] y OKAY Successfully applied patch to the working copy. Reviewers: CC:
This commit is contained in:
parent
b7be6dbf32
commit
efcd70c2d7
2 changed files with 9 additions and 2 deletions
|
@ -199,9 +199,12 @@ EOTEXT
|
||||||
$path = $change->getCurrentPath();
|
$path = $change->getCurrentPath();
|
||||||
$fpath = $repository_api->getPath($path);
|
$fpath = $repository_api->getPath($path);
|
||||||
if (!@file_exists($fpath)) {
|
if (!@file_exists($fpath)) {
|
||||||
$this->confirm(
|
$ok = phutil_console_confirm(
|
||||||
"Patch deletes file '{$path}', but the file does not exist in ".
|
"Patch deletes file '{$path}', but the file does not exist in ".
|
||||||
"the working copy. Continue anyway?");
|
"the working copy. Continue anyway?");
|
||||||
|
if (!$ok) {
|
||||||
|
throw new ArcanistUserAbortException();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$deletes[] = $change->getCurrentPath();
|
$deletes[] = $change->getCurrentPath();
|
||||||
}
|
}
|
||||||
|
@ -218,9 +221,12 @@ EOTEXT
|
||||||
} else {
|
} else {
|
||||||
$verbs = 'moves';
|
$verbs = 'moves';
|
||||||
}
|
}
|
||||||
$this->confirm(
|
$ok = phutil_console_confirm(
|
||||||
"Patch {$verbs} '{$path}' to '{$cpath}', but source path ".
|
"Patch {$verbs} '{$path}' to '{$cpath}', but source path ".
|
||||||
"does not exist in the working copy. Continue anyway?");
|
"does not exist in the working copy. Continue anyway?");
|
||||||
|
if (!$ok) {
|
||||||
|
throw new ArcanistUserAbortException();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$copies[] = array(
|
$copies[] = array(
|
||||||
$change->getOldPath(),
|
$change->getOldPath(),
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
|
|
||||||
phutil_require_module('arcanist', 'exception/usage');
|
phutil_require_module('arcanist', 'exception/usage');
|
||||||
|
phutil_require_module('arcanist', 'exception/usage/userabort');
|
||||||
phutil_require_module('arcanist', 'parser/bundle');
|
phutil_require_module('arcanist', 'parser/bundle');
|
||||||
phutil_require_module('arcanist', 'parser/diff/changetype');
|
phutil_require_module('arcanist', 'parser/diff/changetype');
|
||||||
phutil_require_module('arcanist', 'workflow/base');
|
phutil_require_module('arcanist', 'workflow/base');
|
||||||
|
|
Loading…
Reference in a new issue