]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Fix sanity checks for patch workflow
authorJoshua Spence <josh@joshuaspence.com>
Mon, 25 May 2015 08:38:55 +0000 (18:38 +1000)
committerJoshua Spence <josh@joshuaspence.com>
Mon, 25 May 2015 08:41:28 +0000 (18:41 +1000)
Summary:
Ref T7604. Ref T8307. This was broken in D12962 because I only tested `arc patch --arcbundle`. Furthermore, this particular sanity check doesn't actually do anything now (see T8307).

Test Plan:
Ran `arc patch --nobranch D12971` successfully.

Auditors: epriestley

src/workflow/ArcanistPatchWorkflow.php

index dda5a54c0d5648030cc8a296c6da67ccb26c31a4..7dd62cf2a2f4fee8b554c4911c95c9fcd27023ec 100644 (file)
@@ -954,35 +954,6 @@ EOTEXT
   private function sanityCheck(ArcanistBundle $bundle) {
     $repository_api = $this->getRepositoryAPI();
 
-    // Check to see if the bundle's project id matches the working copy
-    // project id
-    $bundle_project_id = $bundle->getProjectID();
-    $working_copy_project_id = $this->getWorkingCopy()->getProjectID();
-    if (empty($bundle_project_id)) {
-      // 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 = pht(
-          "This patch is for the '%s' project, but the working copy ".
-          "belongs to the '%s' project.",
-          $bundle_project_id,
-          $working_copy_project_id);
-      } else {
-        $issue = pht(
-          "This patch is for the '%s' project, but the working copy does ".
-          "not have an '%s' file to identify which project it belongs to.",
-          $bundle_project_id,
-          '.arcconfig');
-      }
-      $ok = phutil_console_confirm(
-        pht('%s Still try to apply the patch?', $issue),
-        $default_no = false);
-      if (!$ok) {
-        throw new ArcanistUserAbortException();
-      }
-    }
-
     // Check to see if the bundle's base revision matches the working copy
     // base revision
     if ($repository_api->supportsLocalCommits()) {