]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Arcanist / Conduit - stop using deprecated differential.getdiff API
authorBob Trahan <btrahan@phacility.com>
Tue, 3 Feb 2015 22:18:10 +0000 (14:18 -0800)
committerBob Trahan <btrahan@phacility.com>
Tue, 3 Feb 2015 22:18:10 +0000 (14:18 -0800)
Summary: Fixes T7112. Nothing too difficult here.

Test Plan:
meta - submitting this with the new arcanist code
used conduit API to verify the difference between getdiff (just the latest diff) and querydiffs (all diffs that match, with the latest diff first in the set)

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7112

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

src/workflow/ArcanistDiffWorkflow.php
src/workflow/ArcanistFeatureWorkflow.php
src/workflow/ArcanistWorkflow.php

index 6513ef9b5675217f651ea9261d02614333ca8d0f..01742084b43d6273ae6cd6cf8961eba9a11cbd50 100644 (file)
@@ -2173,10 +2173,11 @@ EOTEXT
 
   private function loadActiveLocalCommitInfo() {
     $current_diff = $this->getConduit()->callMethodSynchronous(
-      'differential.getdiff',
+      'differential.querydiffs',
       array(
-        'revision_id' => $this->revisionID,
+        'revisionIDs' => array($this->revisionID),
       ));
+    $current_diff = head($current_diff);
 
     $properties = idx($current_diff, 'properties', array());
     return idx($properties, 'local:commits', array());
index 5ddf0fefaae3d12fa70840153f6546f066e64c07..b69074a0796c6e59297b8b51f601da5217c234fe 100644 (file)
@@ -124,10 +124,11 @@ EOTEXT
       if (preg_match('/^D(\d+)$/', $name, $match)) {
         try {
           $diff = $this->getConduit()->callMethodSynchronous(
-            'differential.getdiff',
+            'differential.querydiffs',
             array(
-              'revision_id' => $match[1],
+              'revisionIDs' => array($match[1]),
             ));
+          $diff = head($diff);
 
           if ($diff['branch'] != '') {
             $name = $diff['branch'];
index 7c5719866c6e261b05afbe7d5f8a9923d0cc7554..5aedab7d9fb60a5f553b86cc9b7cd3c213c1a3e1 100644 (file)
@@ -1064,7 +1064,7 @@ abstract class ArcanistWorkflow extends Phobject {
     return $this->loadBundleFromConduit(
       $conduit,
       array(
-      'diff_id' => $diff_id,
+      'ids' => array($diff_id),
     ));
   }
 
@@ -1075,7 +1075,7 @@ abstract class ArcanistWorkflow extends Phobject {
     return $this->loadBundleFromConduit(
       $conduit,
       array(
-      'revision_id' => $revision_id,
+      'revisionIDs' => array($revision_id),
     ));
   }
 
@@ -1083,8 +1083,8 @@ abstract class ArcanistWorkflow extends Phobject {
     ConduitClient $conduit,
     $params) {
 
-    $future = $conduit->callMethod('differential.getdiff', $params);
-    $diff = $future->resolve();
+    $future = $conduit->callMethod('differential.querydiffs', $params);
+    $diff = head($future->resolve());
 
     $changes = array();
     foreach ($diff['changes'] as $changedict) {