Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistFeatureWorkflow.php
| Show First 20 Lines • Show All 76 Lines • ▼ Show 20 Lines | if (!($repository_api instanceof ArcanistGitAPI) && | ||||
| !($repository_api instanceof ArcanistMercurialAPI)) { | !($repository_api instanceof ArcanistMercurialAPI)) { | ||||
| throw new ArcanistUsageException( | throw new ArcanistUsageException( | ||||
| 'arc feature is only supported under Git and Mercurial.'); | 'arc feature is only supported under Git and Mercurial.'); | ||||
| } | } | ||||
| $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('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('No branches in this working copy.'); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | EOTEXT | ||||
| private function loadCommitInfo(array $branches) { | private function loadCommitInfo(array $branches) { | ||||
| $repository_api = $this->getRepositoryAPI(); | $repository_api = $this->getRepositoryAPI(); | ||||
| $futures = array(); | $futures = array(); | ||||
| foreach ($branches as $branch) { | foreach ($branches as $branch) { | ||||
| if ($repository_api instanceof ArcanistMercurialAPI) { | if ($repository_api instanceof ArcanistMercurialAPI) { | ||||
| $futures[$branch['name']] = $repository_api->execFutureLocal( | $futures[$branch['name']] = $repository_api->execFutureLocal( | ||||
| "log -l 1 --template %s -r %s", | 'log -l 1 --template %s -r %s', | ||||
| "{node}\1{date|hgdate}\1{p1node}\1{desc|firstline}\1{desc}", | "{node}\1{date|hgdate}\1{p1node}\1{desc|firstline}\1{desc}", | ||||
| hgsprintf('%s', $branch['name'])); | hgsprintf('%s', $branch['name'])); | ||||
| } else { | } else { | ||||
| // NOTE: "-s" is an option deep in git's diff argument parser that | // NOTE: "-s" is an option deep in git's diff argument parser that | ||||
| // doesn't seem to have much documentation and has no long form. It | // doesn't seem to have much documentation and has no long form. It | ||||
| // suppresses any diff output. | // suppresses any diff output. | ||||
| $futures[$branch['name']] = $repository_api->execFutureLocal( | $futures[$branch['name']] = $repository_api->execFutureLocal( | ||||
| ▲ Show 20 Lines • Show All 172 Lines • Show Last 20 Lines | |||||