Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistListWorkflow.php
| Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | public function run() { | ||||
| $revisions = $this->getConduit()->callMethodSynchronous( | $revisions = $this->getConduit()->callMethodSynchronous( | ||||
| 'differential.query', | 'differential.query', | ||||
| array( | array( | ||||
| 'authors' => array($this->getUserPHID()), | 'authors' => array($this->getUserPHID()), | ||||
| 'status' => 'status-open', | 'status' => 'status-open', | ||||
| )); | )); | ||||
| if (!$revisions) { | if (!$revisions) { | ||||
| echo "You have no open Differential revisions.\n"; | echo pht('You have no open Differential revisions.')."\n"; | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| $repository_api = $this->getRepositoryAPI(); | $repository_api = $this->getRepositoryAPI(); | ||||
| $info = array(); | $info = array(); | ||||
| foreach ($revisions as $key => $revision) { | foreach ($revisions as $key => $revision) { | ||||
| $revision_path = Filesystem::resolvePath($revision['sourcePath']); | $revision_path = Filesystem::resolvePath($revision['sourcePath']); | ||||
| Show All 21 Lines | public function run() { | ||||
| $info = isort($info, 'sort'); | $info = isort($info, 'sort'); | ||||
| foreach ($info as $key => $spec) { | foreach ($info as $key => $spec) { | ||||
| $revision = $revisions[$key]; | $revision = $revisions[$key]; | ||||
| $table->addRow(array( | $table->addRow(array( | ||||
| 'exists' => $spec['exists'] ? phutil_console_format('**%s**', '*') : '', | 'exists' => $spec['exists'] ? phutil_console_format('**%s**', '*') : '', | ||||
| 'status' => phutil_console_format( | 'status' => phutil_console_format( | ||||
| "<fg:{$spec['color']}>%s</fg>", $spec['statusName']), | "<fg:{$spec['color']}>%s</fg>", | ||||
| $spec['statusName']), | |||||
| 'title' => phutil_console_format( | 'title' => phutil_console_format( | ||||
| '**D%d:** %s', $revision['id'], $revision['title']), | '**D%d:** %s', | ||||
| $revision['id'], | |||||
| $revision['title']), | |||||
| )); | )); | ||||
| } | } | ||||
| $table->draw(); | $table->draw(); | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| } | } | ||||