1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2025-01-22 20:51:09 +01:00

Improve "arc patch" error messages for mismatched local and diff

Summary: We emit a confusing error if there's no ".arcconfig" in the local right now.

Test Plan:
  $ arc patch D3185

    This patch is for the 'phabricator' project,  but the working copy
    belongs to the 'phabricatox' project. Still try to apply the patch? [Y/n]

  $ arc patch D3185

    This patch is for the 'phabricator' project, but the working copy does
    not have an '.arcconfig' file to identify which project it belongs to.
    Still try to apply the patch? [Y/n]

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D3231
This commit is contained in:
epriestley 2012-08-09 18:39:41 -07:00
parent 239b90a076
commit d2e0dc3e68

View file

@ -692,10 +692,18 @@ EOTEXT
// this means $source is SOURCE_PATCH || SOURCE_BUNDLE w/ $version = 0
// they don't come with a project id so just do nothing
} else if ($bundle_project_id != $working_copy_project_id) {
if ($working_copy_project_id) {
$issue =
"This patch is for the '{$bundle_project_id}' project, but the ".
"working copy belongs to the '{$working_copy_project_id}' project.";
} else {
$issue =
"This patch is for the '{$bundle_project_id}' project, but the ".
"working copy does not have an '.arcconfig' file to identify which ".
"project it belongs to.";
}
$ok = phutil_console_confirm(
"This diff is for the '{$bundle_project_id}' project but the working ".
"copy belongs to the '{$working_copy_project_id}' project. ".
"Still try to apply it?",
"{$issue} Still try to apply the patch?",
$default_no = false
);
if (!$ok) {