]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Use `user.query`, not `user.find`, in `arc tasks`
authorepriestley <git@epriestley.com>
Sat, 25 Jan 2014 22:23:23 +0000 (14:23 -0800)
committerepriestley <git@epriestley.com>
Sat, 25 Jan 2014 22:23:23 +0000 (14:23 -0800)
Summary: I'm going to deprecate `user.find`, `user.query` is more modern/powerful and obsoletes it.

Test Plan: Ran `arc tasks --owner epriestley`.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran
Differential Revision: https://secure.phabricator.com/D8070

src/workflow/ArcanistTasksWorkflow.php

index 8eaad2072038df7169cd0e9b127ef004b6932ec1..a97d06891c0a1192514d27a64f49c5699b8abf61 100644 (file)
@@ -228,13 +228,18 @@ EOTEXT
   private function findOwnerPHID($owner) {
     $conduit = $this->getConduit();
 
-    $owner_phid = $conduit->callMethodSynchronous(
-      'user.find',
+    $users = $conduit->callMethodSynchronous(
+      'user.query',
       array(
-        'aliases' => array($owner),
+        'usernames' => array($owner),
       ));
 
-    return idx($owner_phid, $owner);
+    if (!$users) {
+      return null;
+    }
+
+    $user = head($users);
+    return idx($user, 'phid');
   }
 
   private function loadManiphestTasks($status, $owner_phid, $order, $limit) {