1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-25 16:22:42 +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:
epriestley 2011-03-19 12:15:28 -07:00
parent b7be6dbf32
commit efcd70c2d7
2 changed files with 9 additions and 2 deletions

View file

@ -199,9 +199,12 @@ EOTEXT
$path = $change->getCurrentPath();
$fpath = $repository_api->getPath($path);
if (!@file_exists($fpath)) {
$this->confirm(
$ok = phutil_console_confirm(
"Patch deletes file '{$path}', but the file does not exist in ".
"the working copy. Continue anyway?");
if (!$ok) {
throw new ArcanistUserAbortException();
}
} else {
$deletes[] = $change->getCurrentPath();
}
@ -218,9 +221,12 @@ EOTEXT
} else {
$verbs = 'moves';
}
$this->confirm(
$ok = phutil_console_confirm(
"Patch {$verbs} '{$path}' to '{$cpath}', but source path ".
"does not exist in the working copy. Continue anyway?");
if (!$ok) {
throw new ArcanistUserAbortException();
}
} else {
$copies[] = array(
$change->getOldPath(),

View file

@ -7,6 +7,7 @@
phutil_require_module('arcanist', 'exception/usage');
phutil_require_module('arcanist', 'exception/usage/userabort');
phutil_require_module('arcanist', 'parser/bundle');
phutil_require_module('arcanist', 'parser/diff/changetype');
phutil_require_module('arcanist', 'workflow/base');