Changeset View
Changeset View
Standalone View
Standalone View
src/query/ArcanistWorkingCopyCommitHardpointQuery.php
| <?php | <?php | ||||
| final class ArcanistWorkingCopyCommitHardpointQuery | final class ArcanistWorkingCopyCommitHardpointQuery | ||||
| extends ArcanistWorkflowHardpointQuery { | extends ArcanistWorkflowHardpointQuery { | ||||
| public function getHardpoints() { | public function getHardpoints() { | ||||
| return array( | return array( | ||||
| ArcanistWorkingCopyStateRefPro::HARDPOINT_COMMITREF, | ArcanistWorkingCopyStateRef::HARDPOINT_COMMITREF, | ||||
| ); | ); | ||||
| } | } | ||||
| protected function canLoadRef(ArcanistRefPro $ref) { | protected function canLoadRef(ArcanistRef $ref) { | ||||
| return ($ref instanceof ArcanistWorkingCopyStateRefPro); | return ($ref instanceof ArcanistWorkingCopyStateRef); | ||||
| } | } | ||||
| public function loadHardpoint(array $refs, $hardpoint) { | public function loadHardpoint(array $refs, $hardpoint) { | ||||
| yield $this->yieldRequests( | yield $this->yieldRequests( | ||||
| $refs, | $refs, | ||||
| array( | array( | ||||
| ArcanistWorkingCopyStateRefPro::HARDPOINT_BRANCHREF, | ArcanistWorkingCopyStateRef::HARDPOINT_BRANCHREF, | ||||
| )); | )); | ||||
| $branch_refs = mpull($refs, 'getBranchRef'); | $branch_refs = mpull($refs, 'getBranchRef'); | ||||
| yield $this->yieldRequests( | yield $this->yieldRequests( | ||||
| $branch_refs, | $branch_refs, | ||||
| array( | array( | ||||
| ArcanistBranchRefPro::HARDPOINT_COMMITREF, | ArcanistBranchRef::HARDPOINT_COMMITREF, | ||||
| )); | )); | ||||
| $results = array(); | $results = array(); | ||||
| foreach ($refs as $key => $ref) { | foreach ($refs as $key => $ref) { | ||||
| $results[$key] = $ref->getBranchRef()->getCommitRef(); | $results[$key] = $ref->getBranchRef()->getCommitRef(); | ||||
| } | } | ||||
| yield $this->yieldMap($results); | yield $this->yieldMap($results); | ||||
| } | } | ||||
| } | } | ||||