Page MenuHomePhabricator

D13879.diff
No OneTemporary

D13879.diff

diff --git a/src/workflow/ArcanistListWorkflow.php b/src/workflow/ArcanistListWorkflow.php
--- a/src/workflow/ArcanistListWorkflow.php
+++ b/src/workflow/ArcanistListWorkflow.php
@@ -36,7 +36,21 @@
return true;
}
+ public function getArguments() {
+ return array(
+ 'owner' => array(
+ 'param' => 'username',
+ 'paramtype' => 'username',
+ 'help' => pht(
+ 'Only show tasks assigned to the given username, '.
+ 'also accepts %s to show all, default is you.',
+ '@all'),
+ ),
+ );
+ }
+
public function run() {
+ $owner = $this->getArgument('owner');
static $color_map = array(
'Closed' => 'cyan',
'Needs Review' => 'magenta',
@@ -47,10 +61,17 @@
'Abandoned' => 'default',
);
+ if ($owner) {
+ $owner_phid = $this->findOwnerPHID($owner);
+ } else {
+ $owner_phid = $this->getUserPHID();
+ }
+
+
$revisions = $this->getConduit()->callMethodSynchronous(
'differential.query',
array(
- 'authors' => array($this->getUserPHID()),
+ 'authors' => array($owner_phid),
'status' => 'status-open',
));
@@ -106,4 +127,21 @@
return 0;
}
+private function findOwnerPHID($owner) {
+ $conduit = $this->getConduit();
+
+ $users = $conduit->callMethodSynchronous(
+ 'user.query',
+ array(
+ 'usernames' => array($owner),
+ ));
+
+ if (!$users) {
+ return null;
+ }
+
+ $user = head($users);
+ return idx($user, 'phid');
+ }
+
}

File Metadata

Mime Type
text/plain
Expires
Mon, Mar 24, 11:08 AM (2 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7705182
Default Alt Text
D13879.diff (1 KB)

Event Timeline