Changeset View
Changeset View
Standalone View
Standalone View
src/browse/query/ArcanistBrowseCommitHardpointQuery.php
| <?php | <?php | ||||
| final class ArcanistBrowseCommitHardpointQuery | final class ArcanistBrowseCommitHardpointQuery | ||||
| extends ArcanistWorkflowHardpointQuery { | extends ArcanistWorkflowHardpointQuery { | ||||
| public function getHardpoints() { | public function getHardpoints() { | ||||
| return array( | return array( | ||||
| ArcanistBrowseRefPro::HARDPOINT_COMMITREFS, | ArcanistBrowseRef::HARDPOINT_COMMITREFS, | ||||
| ); | ); | ||||
| } | } | ||||
| protected function canLoadRef(ArcanistRefPro $ref) { | protected function canLoadRef(ArcanistRef $ref) { | ||||
| return ($ref instanceof ArcanistBrowseRefPro); | return ($ref instanceof ArcanistBrowseRef); | ||||
| } | } | ||||
| public function loadHardpoint(array $refs, $hardpoint) { | public function loadHardpoint(array $refs, $hardpoint) { | ||||
| $api = $this->getRepositoryAPI(); | $api = $this->getRepositoryAPI(); | ||||
| $commit_map = array(); | $commit_map = array(); | ||||
| foreach ($refs as $key => $ref) { | foreach ($refs as $key => $ref) { | ||||
| $token = $ref->getToken(); | $token = $ref->getToken(); | ||||
| Show All 26 Lines | public function loadHardpoint(array $refs, $hardpoint) { | ||||
| if (!$commit_map) { | if (!$commit_map) { | ||||
| yield $this->yieldMap(array()); | yield $this->yieldMap(array()); | ||||
| } | } | ||||
| $results = array(); | $results = array(); | ||||
| foreach ($commit_map as $commit_identifier => $ref_keys) { | foreach ($commit_map as $commit_identifier => $ref_keys) { | ||||
| foreach ($ref_keys as $key) { | foreach ($ref_keys as $key) { | ||||
| $commit_ref = id(new ArcanistCommitRefPro()) | $commit_ref = id(new ArcanistCommitRef()) | ||||
| ->setCommitHash($commit_identifier); | ->setCommitHash($commit_identifier); | ||||
| $results[$key][] = $commit_ref; | $results[$key][] = $commit_ref; | ||||
| } | } | ||||
| } | } | ||||
| yield $this->yieldMap($results); | yield $this->yieldMap($results); | ||||
| } | } | ||||
| } | } | ||||