Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15512135
D12434.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D12434.id.diff
View Options
diff --git a/src/applications/diffusion/typeahead/DiffusionRepositoryDatasource.php b/src/applications/diffusion/typeahead/DiffusionRepositoryDatasource.php
--- a/src/applications/diffusion/typeahead/DiffusionRepositoryDatasource.php
+++ b/src/applications/diffusion/typeahead/DiffusionRepositoryDatasource.php
@@ -15,11 +15,12 @@
$viewer = $this->getViewer();
$raw_query = $this->getRawQuery();
- $results = array();
+ $query = id(new PhabricatorRepositoryQuery())
+ ->setOrder('name')
+ ->withDatasourceQuery($raw_query);
+ $repos = $this->executeQuery($query);
- $repos = id(new PhabricatorRepositoryQuery())
- ->setViewer($viewer)
- ->execute();
+ $results = array();
foreach ($repos as $repo) {
$results[] = id(new PhabricatorTypeaheadResult())
->setName($repo->getMonogram().' '.$repo->getName())
diff --git a/src/applications/repository/query/PhabricatorRepositoryQuery.php b/src/applications/repository/query/PhabricatorRepositoryQuery.php
--- a/src/applications/repository/query/PhabricatorRepositoryQuery.php
+++ b/src/applications/repository/query/PhabricatorRepositoryQuery.php
@@ -11,6 +11,7 @@
private $nameContains;
private $remoteURIs;
private $anyProjectPHIDs;
+ private $datasourceQuery;
private $numericIdentifiers;
private $callsignIdentifiers;
@@ -103,6 +104,11 @@
return $this;
}
+ public function withDatasourceQuery($query) {
+ $this->datasourceQuery = $query;
+ return $this;
+ }
+
public function needCommitCounts($need_counts) {
$this->needCommitCounts = $need_counts;
return $this;
@@ -493,6 +499,21 @@
$this->anyProjectPHIDs);
}
+ if (strlen($this->datasourceQuery)) {
+ // This handles having "rP" match callsigns starting with "P...".
+ $query = trim($this->datasourceQuery);
+ if (preg_match('/^r/', $query)) {
+ $callsign = substr($query, 1);
+ } else {
+ $callsign = $query;
+ }
+ $where[] = qsprintf(
+ $conn_r,
+ 'r.name LIKE %> OR r.callsign LIKE %>',
+ $query,
+ $callsign);
+ }
+
$where[] = $this->buildPagingClause($conn_r);
return $this->formatWhereClause($where);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 18, 8:28 AM (1 w, 2 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7606912
Default Alt Text
D12434.id.diff (2 KB)
Attached To
Mode
D12434: Improve browsability of Diffusion repository datasource
Attached
Detach File
Event Timeline
Log In to Comment