Changeset View
Changeset View
Standalone View
Standalone View
src/browse/query/ArcanistBrowseRevisionURIHardpointQuery.php
| <?php | <?php | ||||
| final class ArcanistBrowseRevisionURIHardpointQuery | final class ArcanistBrowseRevisionURIHardpointQuery | ||||
| extends ArcanistBrowseURIHardpointQuery { | extends ArcanistBrowseURIHardpointQuery { | ||||
| const BROWSETYPE = 'revision'; | const BROWSETYPE = 'revision'; | ||||
| public function loadHardpoint(array $refs, $hardpoint) { | public function loadHardpoint(array $refs, $hardpoint) { | ||||
| $refs = $this->getRefsWithSupportedTypes($refs); | $refs = $this->getRefsWithSupportedTypes($refs); | ||||
| if (!$refs) { | if (!$refs) { | ||||
| yield $this->yieldMap(array()); | yield $this->yieldMap(array()); | ||||
| } | } | ||||
| yield $this->yieldRequests( | yield $this->yieldRequests( | ||||
| $refs, | $refs, | ||||
| array( | array( | ||||
| ArcanistBrowseRefPro::HARDPOINT_COMMITREFS, | ArcanistBrowseRef::HARDPOINT_COMMITREFS, | ||||
| )); | )); | ||||
| $states = array(); | $states = array(); | ||||
| $map = array(); | $map = array(); | ||||
| foreach ($refs as $key => $ref) { | foreach ($refs as $key => $ref) { | ||||
| foreach ($ref->getCommitRefs() as $commit_ref) { | foreach ($ref->getCommitRefs() as $commit_ref) { | ||||
| $hash = $commit_ref->getCommitHash(); | $hash = $commit_ref->getCommitHash(); | ||||
| $states[$hash] = id(new ArcanistWorkingCopyStateRefPro()) | $states[$hash] = id(new ArcanistWorkingCopyStateRef()) | ||||
| ->setCommitRef($commit_ref); | ->setCommitRef($commit_ref); | ||||
| $map[$hash][] = $key; | $map[$hash][] = $key; | ||||
| } | } | ||||
| } | } | ||||
| if (!$states) { | if (!$states) { | ||||
| yield $this->yieldMap(array()); | yield $this->yieldMap(array()); | ||||
| } | } | ||||
| Show All 29 Lines | |||||