Differential D15790 Diff 38050 src/applications/diffusion/conduit/DiffusionQueryCommitsConduitAPIMethod.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/conduit/DiffusionQueryCommitsConduitAPIMethod.php
Show All 23 Lines | return array( | ||||
'needMessages' => 'optional bool', | 'needMessages' => 'optional bool', | ||||
'bypassCache' => 'optional bool', | 'bypassCache' => 'optional bool', | ||||
) + $this->getPagerParamTypes(); | ) + $this->getPagerParamTypes(); | ||||
} | } | ||||
protected function execute(ConduitAPIRequest $request) { | protected function execute(ConduitAPIRequest $request) { | ||||
$need_messages = $request->getValue('needMessages'); | $need_messages = $request->getValue('needMessages'); | ||||
$bypass_cache = $request->getValue('bypassCache'); | $bypass_cache = $request->getValue('bypassCache'); | ||||
$viewer = $request->getUser(); | |||||
$query = id(new DiffusionCommitQuery()) | $query = id(new DiffusionCommitQuery()) | ||||
->setViewer($request->getUser()) | ->setViewer($viewer) | ||||
->needCommitData(true); | ->needCommitData(true); | ||||
$repository_phid = $request->getValue('repositoryPHID'); | $repository_phid = $request->getValue('repositoryPHID'); | ||||
if ($repository_phid) { | if ($repository_phid) { | ||||
$repository = id(new PhabricatorRepositoryQuery()) | $repository = id(new PhabricatorRepositoryQuery()) | ||||
->setViewer($request->getUser()) | ->setViewer($viewer) | ||||
->withPHIDs(array($repository_phid)) | ->withPHIDs(array($repository_phid)) | ||||
->executeOne(); | ->executeOne(); | ||||
if ($repository) { | if ($repository) { | ||||
$query->withRepository($repository); | $query->withRepository($repository); | ||||
if ($bypass_cache) { | if ($bypass_cache) { | ||||
$repository->synchronizeWorkingCopyBeforeRead(); | id(new DiffusionRepositoryClusterEngine()) | ||||
->setViewer($viewer) | |||||
->setRepository($repository) | |||||
->synchronizeWorkingCopyBeforeRead(); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
$names = $request->getValue('names'); | $names = $request->getValue('names'); | ||||
if ($names) { | if ($names) { | ||||
$query->withIdentifiers($names); | $query->withIdentifiers($names); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 87 Lines • Show Last 20 Lines |