Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistWhichWorkflow.php
| Show All 37 Lines | EOTEXT | ||||
| } | } | ||||
| public function requiresAuthentication() { | public function requiresAuthentication() { | ||||
| return true; | return true; | ||||
| } | } | ||||
| public function getArguments() { | public function getArguments() { | ||||
| return array( | return array( | ||||
| 'any-author' => array( | |||||
| 'help' => "Show revisions by any author, not just you.", | |||||
| ), | |||||
| 'any-status' => array( | 'any-status' => array( | ||||
| 'help' => "Show committed and abandoned revisions.", | 'help' => "Show committed and abandoned revisions.", | ||||
| ), | ), | ||||
| 'base' => array( | 'base' => array( | ||||
| 'param' => 'rules', | 'param' => 'rules', | ||||
| 'help' => 'Additional rules for determining base revision.', | 'help' => 'Additional rules for determining base revision.', | ||||
| 'nosupport' => array( | 'nosupport' => array( | ||||
| 'svn' => 'Subversion does not use base commits.', | 'svn' => 'Subversion does not use base commits.', | ||||
| ▲ Show 20 Lines • Show All 76 Lines • ▼ Show 20 Lines | if ($repository_api->supportsCommitRanges()) { | ||||
| "You can see the exact changes that will be sent by running ". | "You can see the exact changes that will be sent by running ". | ||||
| "this command:\n\n". | "this command:\n\n". | ||||
| " $ {$command}\n\n". | " $ {$command}\n\n". | ||||
| "These commits will be included in the diff:\n\n"); | "These commits will be included in the diff:\n\n"); | ||||
| echo $commits."\n\n\n"; | echo $commits."\n\n\n"; | ||||
| } | } | ||||
| $any_author = $this->getArgument('any-author'); | |||||
| $any_status = $this->getArgument('any-status'); | $any_status = $this->getArgument('any-status'); | ||||
| $query = array( | $query = array( | ||||
| 'authors' => $any_author | 'authors' => null, | ||||
epriestley: You can just omit this parameter. | |||||
| ? null | |||||
| : array($this->getUserPHID()), | |||||
| 'status' => $any_status | 'status' => $any_status | ||||
| ? 'status-any' | ? 'status-any' | ||||
| : 'status-open', | : 'status-open', | ||||
| ); | ); | ||||
| $revisions = $repository_api->loadWorkingCopyDifferentialRevisions( | $revisions = $repository_api->loadWorkingCopyDifferentialRevisions( | ||||
| $this->getConduit(), | $this->getConduit(), | ||||
| $query); | $query); | ||||
| Show All 9 Lines | if (empty($revisions)) { | ||||
| echo "\n"; | echo "\n"; | ||||
| echo phutil_console_wrap( | echo phutil_console_wrap( | ||||
| phutil_console_format( | phutil_console_format( | ||||
| "Since there are no revisions in Differential which match this ". | "Since there are no revisions in Differential which match this ". | ||||
| "working copy, a new revision will be **created** if you run ". | "working copy, a new revision will be **created** if you run ". | ||||
| "'arc diff{$arg}'.\n\n")); | "'arc diff{$arg}'.\n\n")); | ||||
| } else { | } else { | ||||
| foreach ($revisions as $revision) { | foreach ($revisions as $revision) { | ||||
| echo ' D'.$revision['id'].' '.$revision['title']."\n"; | $conduit = $this->getConduit(); | ||||
| $users = $conduit->callMethodSynchronous('user.query', | |||||
| array('phids' => | |||||
| array($revision['authorPHID'] | |||||
| ))); | |||||
| $author = $users[0]['userName']; | |||||
| echo ' D'.$revision['id'].' '.$revision['title']; | |||||
| echo ' (owned by ' . $author . ")\n"; | |||||
| echo ' Reason: '.$revision['why']."\n"; | echo ' Reason: '.$revision['why']."\n"; | ||||
| echo "\n"; | echo "\n"; | ||||
| } | } | ||||
| if (count($revisions) == 1) { | if (count($revisions) == 1) { | ||||
| echo phutil_console_wrap( | echo phutil_console_wrap( | ||||
| phutil_console_format( | phutil_console_format( | ||||
| "Since exactly one revision in Differential matches this working ". | "Since exactly one revision in Differential matches this working ". | ||||
| "copy, it will be **updated** if you run 'arc diff{$arg}'.")); | "copy, it will be **updated** if you run 'arc diff{$arg}'.")); | ||||
| ▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines | |||||
You can just omit this parameter.