]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Remove call to "arcanist.projectinfo" from `arc export`
authorJoshua Spence <josh@joshuaspence.com>
Mon, 25 May 2015 08:31:09 +0000 (18:31 +1000)
committerJoshua Spence <josh@joshuaspence.com>
Mon, 25 May 2015 08:31:09 +0000 (18:31 +1000)
Summary:
Ref T7604. Remove a call to `arcanist.projectinfo` from `arc export`. This Conduit call was only used to detect the repository encoding, which we should be able to do locally anyway.

I was considering removing the `$projectName` from `ArcanistBundle` as well, but I'm not convinved that this is a good idea. Specifically, doing so would make it difficult to issue the "This patch is for the 'X' project, but the working copy belongs to the 'Y' project" error. We could potentially use the repository callsign for this purposes, but this isn't portable across installs.

Test Plan: I'm not quite sure how to test this. I suspect that this functionality isn't widely used anyway.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7604

Differential Revision: https://secure.phabricator.com/D12962

src/parser/ArcanistBundle.php
src/workflow/ArcanistExportWorkflow.php
src/workflow/ArcanistWorkflow.php

index 7324b8ea8cd3fbdd5328e058a6e9b61a3f4e3045..b642292c36abfe7e094fd5c606a1b8e9a1e81740 100644 (file)
@@ -9,7 +9,6 @@ final class ArcanistBundle {
   private $conduit;
   private $blobs = array();
   private $diskPath;
-  private $projectID;
   private $baseRevision;
   private $revisionID;
   private $encoding;
@@ -63,15 +62,6 @@ final class ArcanistBundle {
     return $this;
   }
 
-  public function setProjectID($project_id) {
-    $this->projectID = $project_id;
-    return $this;
-  }
-
-  public function getProjectID() {
-    return $this->projectID;
-  }
-
   public function setBaseRevision($base_revision) {
     $this->baseRevision = $base_revision;
     return $this;
@@ -178,7 +168,6 @@ final class ArcanistBundle {
     $obj = new ArcanistBundle();
     $obj->changes = $changes;
     $obj->diskPath = $path;
-    $obj->setProjectID($project_name);
     $obj->setBaseRevision($base_revision);
     $obj->setRevisionID($revision_id);
     $obj->setEncoding($encoding);
@@ -228,7 +217,6 @@ final class ArcanistBundle {
 
     $meta_info = array(
       'version'      => 5,
-      'projectName'  => $this->getProjectID(),
       'baseRevision' => $this->getBaseRevision(),
       'revisionID'   => $this->getRevisionID(),
       'encoding'     => $this->getEncoding(),
index d3e3b3962345d5714bbe7eca8ece89d6ddb76dce..edff8fd62df446e8020a0d106ab84a125b473568 100644 (file)
@@ -225,7 +225,6 @@ EOTEXT
         }
 
         $bundle = ArcanistBundle::newFromChanges($changes);
-        $bundle->setProjectID($this->getWorkingCopy()->getProjectID());
         $bundle->setBaseRevision(
           $repository_api->getSourceControlBaseRevision());
         // NOTE: we can't get a revision ID for SOURCE_LOCAL
@@ -247,18 +246,6 @@ EOTEXT
     }
 
     $try_encoding = nonempty($this->getArgument('encoding'), null);
-    if (!$try_encoding) {
-      try {
-        $project_info = $this->getConduit()->callMethodSynchronous(
-          'arcanist.projectinfo',
-          array(
-            'name' => $bundle->getProjectID(),
-          ));
-        $try_encoding = $project_info['encoding'];
-      } catch (ConduitClientException $e) {
-        $try_encoding = null;
-      }
-    }
 
     if ($try_encoding) {
       $bundle->setEncoding($try_encoding);
index 117bbe943f5aefe1e680b8532fe2aeac74094d9d..ed05b743ce602542c6bcc824cda32ffd92d17ee3 100644 (file)
@@ -1173,7 +1173,6 @@ abstract class ArcanistWorkflow extends Phobject {
     $bundle->setConduit($conduit);
     // since the conduit method has changes, assume that these fields
     // could be unset
-    $bundle->setProjectID(idx($diff, 'projectName'));
     $bundle->setBaseRevision(idx($diff, 'sourceControlBaseRevision'));
     $bundle->setRevisionID(idx($diff, 'revisionID'));
     $bundle->setAuthorName(idx($diff, 'authorName'));