3 final class DiffusionInternalCommitSearchEngine
4 extends PhabricatorApplicationSearchEngine
{
6 public function getResultTypeDescription() {
7 return pht('Diffusion Raw Commits');
10 public function getApplicationClassName() {
11 return 'PhabricatorDiffusionApplication';
14 public function newQuery() {
15 return new DiffusionCommitQuery();
18 protected function buildQueryFromParameters(array $map) {
19 $query = $this->newQuery();
21 if ($map['repositoryPHIDs']) {
22 $query->withRepositoryPHIDs($map['repositoryPHIDs']);
28 protected function buildCustomSearchFields() {
30 id(new PhabricatorSearchDatasourceField())
31 ->setLabel(pht('Repositories'))
32 ->setKey('repositoryPHIDs')
33 ->setDatasource(new DiffusionRepositoryFunctionDatasource())
34 ->setDescription(pht('Find commits in particular repositories.')),
38 protected function getURI($path) {
42 protected function renderResultList(
44 PhabricatorSavedQuery
$query,
49 protected function getObjectWireFieldsForConduit(
51 array $field_extensions,
52 array $extension_data) {
55 $viewer = $this->requireViewer();
57 $repository = $commit->getRepository();
58 $identifier = $commit->getCommitIdentifier();
60 id(new DiffusionRepositoryClusterEngine())
62 ->setRepository($repository)
63 ->synchronizeWorkingCopyBeforeRead();
65 $ref = id(new DiffusionLowLevelCommitQuery())
66 ->setRepository($repository)
67 ->withIdentifier($identifier)
71 'ref' => $ref->newDictionary(),