Differential D10746 Diff 25795 src/applications/diffusion/query/lowlevel/DiffusionLowLevelCommitFieldsQuery.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/query/lowlevel/DiffusionLowLevelCommitFieldsQuery.php
Show First 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | if (!$revision_id && $hashes) { | ||||
->needHashes(true) | ->needHashes(true) | ||||
->withCommitHashes($hash_list) | ->withCommitHashes($hash_list) | ||||
->execute(); | ->execute(); | ||||
if (!empty($revisions)) { | if (!empty($revisions)) { | ||||
$revision = $this->pickBestRevision($revisions); | $revision = $this->pickBestRevision($revisions); | ||||
$fields['revisionID'] = $revision->getID(); | $fields['revisionID'] = $revision->getID(); | ||||
$revision_hashes = $revision->getHashes(); | $revision_hashes = $revision->getHashes(); | ||||
$revision_hashes = DiffusionCommitHash::convertArrayToObjects( | |||||
$revision_hashes); | |||||
$revision_hashes = mpull($revision_hashes, 'getHashType'); | $revision_hashes = mpull($revision_hashes, 'getHashType'); | ||||
// sort the hashes in the order the mighty | // sort the hashes in the order the mighty | ||||
// @{class:ArcanstDifferentialRevisionHash} does; probably unnecessary | // @{class:ArcanstDifferentialRevisionHash} does; probably unnecessary | ||||
// but should future proof things nicely. | // but should future proof things nicely. | ||||
$revision_hashes = array_select_keys( | $revision_hashes = array_select_keys( | ||||
$revision_hashes, | $revision_hashes, | ||||
ArcanistDifferentialRevisionHash::getTypes()); | ArcanistDifferentialRevisionHash::getTypes()); | ||||
foreach ($hashes as $hash) { | foreach ($hashes as $hash) { | ||||
$revision_hash = $revision_hashes[$hash->getHashType()]; | $revision_hash = idx($revision_hashes, $hash->getHashType()); | ||||
if (!$revision_hash) { | |||||
continue; | |||||
} | |||||
if ($revision_hash->getHashValue() == $hash->getHashValue()) { | if ($revision_hash->getHashValue() == $hash->getHashValue()) { | ||||
$this->setRevisionMatchData( | $this->setRevisionMatchData( | ||||
'matchHashType', | 'matchHashType', | ||||
$hash->getHashType()); | $hash->getHashType()); | ||||
$this->setRevisionMatchData( | $this->setRevisionMatchData( | ||||
'matchHashValue', | 'matchHashValue', | ||||
$hash->getHashValue()); | $hash->getHashValue()); | ||||
break; | break; | ||||
▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines |