From d98c1049910d265a588d27f453e586449385811d Mon Sep 17 00:00:00 2001 From: Bob Trahan Date: Tue, 3 Feb 2015 14:18:10 -0800 Subject: [PATCH] Arcanist / Conduit - stop using deprecated differential.getdiff API 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 | 5 +++-- src/workflow/ArcanistFeatureWorkflow.php | 5 +++-- src/workflow/ArcanistWorkflow.php | 8 ++++---- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/workflow/ArcanistDiffWorkflow.php b/src/workflow/ArcanistDiffWorkflow.php index 6513ef9b..01742084 100644 --- a/src/workflow/ArcanistDiffWorkflow.php +++ b/src/workflow/ArcanistDiffWorkflow.php @@ -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()); diff --git a/src/workflow/ArcanistFeatureWorkflow.php b/src/workflow/ArcanistFeatureWorkflow.php index 5ddf0fef..b69074a0 100644 --- a/src/workflow/ArcanistFeatureWorkflow.php +++ b/src/workflow/ArcanistFeatureWorkflow.php @@ -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']; diff --git a/src/workflow/ArcanistWorkflow.php b/src/workflow/ArcanistWorkflow.php index 7c571986..5aedab7d 100644 --- a/src/workflow/ArcanistWorkflow.php +++ b/src/workflow/ArcanistWorkflow.php @@ -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) {