Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistFeatureWorkflow.php
| Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | EOTEXT | ||||
| public function requiresAuthentication() { | public function requiresAuthentication() { | ||||
| return !$this->getArgument('branch'); | return !$this->getArgument('branch'); | ||||
| } | } | ||||
| public function getArguments() { | public function getArguments() { | ||||
| return array( | return array( | ||||
| 'view-all' => array( | 'view-all' => array( | ||||
| 'help' => 'Include closed and abandoned revisions.', | 'help' => pht('Include closed and abandoned revisions.'), | ||||
| ), | ), | ||||
| 'by-status' => array( | 'by-status' => array( | ||||
| 'help' => 'Sort branches by status instead of time.', | 'help' => pht('Sort branches by status instead of time.'), | ||||
| ), | ), | ||||
| 'output' => array( | 'output' => array( | ||||
| 'param' => 'format', | 'param' => 'format', | ||||
| 'support' => array( | 'support' => array( | ||||
| 'json', | 'json', | ||||
| ), | ), | ||||
| 'help' => "With 'json', show features in machine-readable JSON format.", | 'help' => pht( | ||||
| "With '%s', show features in machine-readable JSON format.", | |||||
| 'json'), | |||||
| ), | ), | ||||
| '*' => 'branch', | '*' => 'branch', | ||||
| ); | ); | ||||
| } | } | ||||
| public function getSupportedRevisionControlSystems() { | public function getSupportedRevisionControlSystems() { | ||||
| return array('git', 'hg'); | return array('git', 'hg'); | ||||
| } | } | ||||
| public function run() { | public function run() { | ||||
| $repository_api = $this->getRepositoryAPI(); | $repository_api = $this->getRepositoryAPI(); | ||||
| $names = $this->getArgument('branch'); | $names = $this->getArgument('branch'); | ||||
| if ($names) { | if ($names) { | ||||
| if (count($names) > 2) { | if (count($names) > 2) { | ||||
| throw new ArcanistUsageException('Specify only one branch.'); | throw new ArcanistUsageException(pht('Specify only one branch.')); | ||||
| } | } | ||||
| return $this->checkoutBranch($names); | return $this->checkoutBranch($names); | ||||
| } | } | ||||
| $branches = $repository_api->getAllBranches(); | $branches = $repository_api->getAllBranches(); | ||||
| if (!$branches) { | if (!$branches) { | ||||
| throw new ArcanistUsageException('No branches in this working copy.'); | throw new ArcanistUsageException( | ||||
| pht('No branches in this working copy.')); | |||||
| } | } | ||||
| $branches = $this->loadCommitInfo($branches); | $branches = $this->loadCommitInfo($branches); | ||||
| $revisions = $this->loadRevisions($branches); | $revisions = $this->loadRevisions($branches); | ||||
| $this->printBranches($branches, $revisions); | $this->printBranches($branches, $revisions); | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 199 Lines • ▼ Show 20 Lines | foreach ($branches as $branch) { | ||||
| } | } | ||||
| } | } | ||||
| if ($revision) { | if ($revision) { | ||||
| $desc = 'D'.$revision['id'].': '.$revision['title']; | $desc = 'D'.$revision['id'].': '.$revision['title']; | ||||
| $status = $revision['statusName']; | $status = $revision['statusName']; | ||||
| } else { | } else { | ||||
| $desc = $branch['desc']; | $desc = $branch['desc']; | ||||
| $status = 'No Revision'; | $status = pht('No Revision'); | ||||
| } | } | ||||
| if (!$this->getArgument('view-all') && !$branch['current']) { | if (!$this->getArgument('view-all') && !$branch['current']) { | ||||
| if ($status == 'Closed' || $status == 'Abandoned') { | if ($status == 'Closed' || $status == 'Abandoned') { | ||||
| continue; | continue; | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines | |||||