Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15394057
D17426.id41902.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
6 KB
Referenced Files
None
Subscribers
None
D17426.id41902.diff
View Options
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -482,7 +482,6 @@
'DifferentialReleephRequestFieldSpecification' => 'applications/releeph/differential/DifferentialReleephRequestFieldSpecification.php',
'DifferentialRemarkupRule' => 'applications/differential/remarkup/DifferentialRemarkupRule.php',
'DifferentialReplyHandler' => 'applications/differential/mail/DifferentialReplyHandler.php',
- 'DifferentialRepositoryDatasource' => 'applications/differential/typeahead/DifferentialRepositoryDatasource.php',
'DifferentialRepositoryField' => 'applications/differential/customfield/DifferentialRepositoryField.php',
'DifferentialRepositoryLookup' => 'applications/differential/query/DifferentialRepositoryLookup.php',
'DifferentialRequiredSignaturesField' => 'applications/differential/customfield/DifferentialRequiredSignaturesField.php',
@@ -827,6 +826,7 @@
'DiffusionRepositoryEditDeleteController' => 'applications/diffusion/controller/DiffusionRepositoryEditDeleteController.php',
'DiffusionRepositoryEditEngine' => 'applications/diffusion/editor/DiffusionRepositoryEditEngine.php',
'DiffusionRepositoryEditUpdateController' => 'applications/diffusion/controller/DiffusionRepositoryEditUpdateController.php',
+ 'DiffusionRepositoryFunctionDatasource' => 'applications/diffusion/typeahead/DiffusionRepositoryFunctionDatasource.php',
'DiffusionRepositoryHistoryManagementPanel' => 'applications/diffusion/management/DiffusionRepositoryHistoryManagementPanel.php',
'DiffusionRepositoryListController' => 'applications/diffusion/controller/DiffusionRepositoryListController.php',
'DiffusionRepositoryManageController' => 'applications/diffusion/controller/DiffusionRepositoryManageController.php',
@@ -5211,7 +5211,6 @@
'DifferentialReleephRequestFieldSpecification' => 'Phobject',
'DifferentialRemarkupRule' => 'PhabricatorObjectRemarkupRule',
'DifferentialReplyHandler' => 'PhabricatorApplicationTransactionReplyHandler',
- 'DifferentialRepositoryDatasource' => 'PhabricatorTypeaheadCompositeDatasource',
'DifferentialRepositoryField' => 'DifferentialCoreCustomField',
'DifferentialRepositoryLookup' => 'Phobject',
'DifferentialRequiredSignaturesField' => 'DifferentialCoreCustomField',
@@ -5575,6 +5574,7 @@
'DiffusionRepositoryEditDeleteController' => 'DiffusionRepositoryManageController',
'DiffusionRepositoryEditEngine' => 'PhabricatorEditEngine',
'DiffusionRepositoryEditUpdateController' => 'DiffusionRepositoryManageController',
+ 'DiffusionRepositoryFunctionDatasource' => 'PhabricatorTypeaheadCompositeDatasource',
'DiffusionRepositoryHistoryManagementPanel' => 'DiffusionRepositoryManagementPanel',
'DiffusionRepositoryListController' => 'DiffusionController',
'DiffusionRepositoryManageController' => 'DiffusionController',
diff --git a/src/applications/audit/query/PhabricatorCommitSearchEngine.php b/src/applications/audit/query/PhabricatorCommitSearchEngine.php
--- a/src/applications/audit/query/PhabricatorCommitSearchEngine.php
+++ b/src/applications/audit/query/PhabricatorCommitSearchEngine.php
@@ -85,7 +85,7 @@
->setKey('repositoryPHIDs')
->setConduitKey('repositories')
->setAliases(array('repository', 'repositories', 'repositoryPHID'))
- ->setDatasource(new DiffusionRepositoryDatasource()),
+ ->setDatasource(new DiffusionRepositoryFunctionDatasource()),
id(new PhabricatorSearchDatasourceField())
->setLabel(pht('Packages'))
->setKey('packagePHIDs')
diff --git a/src/applications/differential/query/DifferentialRevisionSearchEngine.php b/src/applications/differential/query/DifferentialRevisionSearchEngine.php
--- a/src/applications/differential/query/DifferentialRevisionSearchEngine.php
+++ b/src/applications/differential/query/DifferentialRevisionSearchEngine.php
@@ -75,7 +75,7 @@
->setLabel(pht('Repositories'))
->setKey('repositoryPHIDs')
->setAliases(array('repository', 'repositories', 'repositoryPHID'))
- ->setDatasource(new DifferentialRepositoryDatasource())
+ ->setDatasource(new DiffusionRepositoryFunctionDatasource())
->setDescription(
pht('Find revisions from specific repositories.')),
id(new PhabricatorSearchSelectField())
diff --git a/src/applications/differential/typeahead/DifferentialRepositoryDatasource.php b/src/applications/diffusion/typeahead/DiffusionRepositoryFunctionDatasource.php
rename from src/applications/differential/typeahead/DifferentialRepositoryDatasource.php
rename to src/applications/diffusion/typeahead/DiffusionRepositoryFunctionDatasource.php
--- a/src/applications/differential/typeahead/DifferentialRepositoryDatasource.php
+++ b/src/applications/diffusion/typeahead/DiffusionRepositoryFunctionDatasource.php
@@ -1,6 +1,6 @@
<?php
-final class DifferentialRepositoryDatasource
+final class DiffusionRepositoryFunctionDatasource
extends PhabricatorTypeaheadCompositeDatasource {
public function getBrowseTitle() {
diff --git a/src/applications/diffusion/typeahead/DiffusionTaggedRepositoriesFunctionDatasource.php b/src/applications/diffusion/typeahead/DiffusionTaggedRepositoriesFunctionDatasource.php
--- a/src/applications/diffusion/typeahead/DiffusionTaggedRepositoriesFunctionDatasource.php
+++ b/src/applications/diffusion/typeahead/DiffusionTaggedRepositoriesFunctionDatasource.php
@@ -67,11 +67,19 @@
->execute();
$results = array();
-
foreach ($repositories as $repository) {
$results[] = $repository->getPHID();
}
+ if (!$results) {
+ // TODO: This is a little hacky, but if you query for "tagged(x)" and
+ // there are no such repositories, we want to match nothing. If we
+ // just return `array()`, that gets evaluated as "no constraint" and
+ // we match everything. This works correctly for now, but should be
+ // replaced with some more elegant/general approach eventually.
+ $results[] = PhabricatorPHIDConstants::PHID_VOID;
+ }
+
return $results;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 16, 11:19 PM (2 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7389445
Default Alt Text
D17426.id41902.diff (6 KB)
Attached To
Mode
D17426: Allow commits to be queried by repository using the `tagged(...)` typehaead function
Attached
Detach File
Event Timeline
Log In to Comment