Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/query/DiffusionCachedResolveRefsQuery.php
| Show First 20 Lines • Show All 100 Lines • ▼ Show 20 Lines | private function resolveGitAndMercurialRefs() { | ||||
| $name_hashes = array(); | $name_hashes = array(); | ||||
| foreach ($this->refs as $ref) { | foreach ($this->refs as $ref) { | ||||
| $name_hashes[PhabricatorHash::digestForIndex($ref)] = $ref; | $name_hashes[PhabricatorHash::digestForIndex($ref)] = $ref; | ||||
| } | } | ||||
| $cursors = queryfx_all( | $cursors = queryfx_all( | ||||
| $conn_r, | $conn_r, | ||||
| 'SELECT refNameHash, refType, commitIdentifier, isClosed FROM %T | 'SELECT c.refNameHash, c.refType, p.commitIdentifier, p.isClosed | ||||
| WHERE repositoryPHID = %s AND refNameHash IN (%Ls)', | FROM %T c JOIN %T p ON p.cursorID = c.id | ||||
| WHERE c.repositoryPHID = %s AND c.refNameHash IN (%Ls)', | |||||
| id(new PhabricatorRepositoryRefCursor())->getTableName(), | id(new PhabricatorRepositoryRefCursor())->getTableName(), | ||||
| id(new PhabricatorRepositoryRefPosition())->getTableName(), | |||||
| $repository->getPHID(), | $repository->getPHID(), | ||||
| array_keys($name_hashes)); | array_keys($name_hashes)); | ||||
| foreach ($cursors as $cursor) { | foreach ($cursors as $cursor) { | ||||
| if (isset($name_hashes[$cursor['refNameHash']])) { | if (isset($name_hashes[$cursor['refNameHash']])) { | ||||
| $results[$name_hashes[$cursor['refNameHash']]][] = array( | $results[$name_hashes[$cursor['refNameHash']]][] = array( | ||||
| 'type' => $cursor['refType'], | 'type' => $cursor['refType'], | ||||
| 'identifier' => $cursor['commitIdentifier'], | 'identifier' => $cursor['commitIdentifier'], | ||||
| ▲ Show 20 Lines • Show All 66 Lines • Show Last 20 Lines | |||||