Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistFeatureWorkflow.php
| Show First 20 Lines • Show All 168 Lines • ▼ Show 20 Lines | private function checkoutBranch(array $names) { | ||||
| echo $stdout; | echo $stdout; | ||||
| fprintf(STDERR, $stderr); | fprintf(STDERR, $stderr); | ||||
| return $err; | return $err; | ||||
| } | } | ||||
| private function loadCommitInfo(array $branches) { | private function loadCommitInfo(array $branches) { | ||||
| $repository_api = $this->getRepositoryAPI(); | $repository_api = $this->getRepositoryAPI(); | ||||
| $branches = ipull($branches, null, 'name'); | |||||
| if ($repository_api instanceof ArcanistMercurialAPI) { | |||||
| $futures = array(); | $futures = array(); | ||||
| foreach ($branches as $branch) { | foreach ($branches as $branch) { | ||||
| 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 { | |||||
| // 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 | |||||
| // suppresses any diff output. | |||||
| $futures[$branch['name']] = $repository_api->execFutureLocal( | |||||
| 'show -s --format=%C %s --', | |||||
| '%H%x01%ct%x01%T%x01%s%x01%s%n%n%b', | |||||
| $branch['name']); | |||||
| } | |||||
| } | } | ||||
| $branches = ipull($branches, null, 'name'); | |||||
| $futures = id(new FutureIterator($futures)) | $futures = id(new FutureIterator($futures)) | ||||
| ->limit(16); | ->limit(16); | ||||
| foreach ($futures as $name => $future) { | foreach ($futures as $name => $future) { | ||||
| list($info) = $future->resolvex(); | list($info) = $future->resolvex(); | ||||
| list($hash, $epoch, $tree, $desc, $text) = explode("\1", trim($info), 5); | |||||
| $branch = $branches[$name] + array( | $fields = explode("\1", trim($info), 5); | ||||
| list($hash, $epoch, $tree, $desc, $text) = $fields; | |||||
| $branches[$name] += array( | |||||
| 'hash' => $hash, | 'hash' => $hash, | ||||
| 'desc' => $desc, | 'desc' => $desc, | ||||
| 'tree' => $tree, | 'tree' => $tree, | ||||
| 'epoch' => (int)$epoch, | 'epoch' => (int)$epoch, | ||||
| 'text' => $text, | |||||
| ); | ); | ||||
| } | |||||
| } | |||||
| foreach ($branches as $name => $branch) { | |||||
| $text = $branch['text']; | |||||
| try { | try { | ||||
| $message = ArcanistDifferentialCommitMessage::newFromRawCorpus($text); | $message = ArcanistDifferentialCommitMessage::newFromRawCorpus($text); | ||||
| $id = $message->getRevisionID(); | $id = $message->getRevisionID(); | ||||
| $branch['revisionID'] = $id; | $branch['revisionID'] = $id; | ||||
| } catch (ArcanistUsageException $ex) { | } catch (ArcanistUsageException $ex) { | ||||
| // In case of invalid commit message which fails the parsing, | // In case of invalid commit message which fails the parsing, | ||||
| ▲ Show 20 Lines • Show All 110 Lines • ▼ Show 20 Lines | foreach ($branches as $branch) { | ||||
| 'revision' => $revision ? $revision['id'] : null, | 'revision' => $revision ? $revision['id'] : null, | ||||
| 'color' => $color, | 'color' => $color, | ||||
| 'esort' => $epoch, | 'esort' => $epoch, | ||||
| 'epoch' => $epoch, | 'epoch' => $epoch, | ||||
| 'ssort' => $ssort, | 'ssort' => $ssort, | ||||
| ); | ); | ||||
| } | } | ||||
| if (!$out) { | |||||
| // All of the revisions are closed or abandoned. | |||||
| return; | |||||
| } | |||||
| $len_name = max(array_map('strlen', ipull($out, 'name'))) + 2; | $len_name = max(array_map('strlen', ipull($out, 'name'))) + 2; | ||||
| $len_status = max(array_map('strlen', ipull($out, 'status'))) + 2; | $len_status = max(array_map('strlen', ipull($out, 'status'))) + 2; | ||||
| if ($this->getArgument('by-status')) { | if ($this->getArgument('by-status')) { | ||||
| $out = isort($out, 'ssort'); | $out = isort($out, 'ssort'); | ||||
| } else { | } else { | ||||
| $out = isort($out, 'esort'); | $out = isort($out, 'esort'); | ||||
| } | } | ||||
| Show All 28 Lines | |||||