Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14031579
D10268.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
D10268.id.diff
View Options
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
@@ -61,9 +61,6 @@
$repository_phids = $saved->getParameter('repositoryPHIDs', array());
if ($repository_phids) {
- // $repository_phids need to be mapped to $repository_ids via a subquery
- // so make sure $viewer is set...!
- $query->setViewer($this->requireViewer());
$query->withRepositoryPHIDs($repository_phids);
}
diff --git a/src/applications/diffusion/query/DiffusionCommitQuery.php b/src/applications/diffusion/query/DiffusionCommitQuery.php
--- a/src/applications/diffusion/query/DiffusionCommitQuery.php
+++ b/src/applications/diffusion/query/DiffusionCommitQuery.php
@@ -9,6 +9,7 @@
private $defaultRepository;
private $identifiers;
private $repositoryIDs;
+ private $repositoryPHIDs;
private $identifierMap;
private $needAuditRequests;
@@ -63,19 +64,9 @@
* Look up commits in a specific repository. Prefer
* @{method:withRepositoryIDs}; the underyling table is keyed by ID such
* that this method requires a separate initial query to map PHID to ID.
- * Furthermore, this method requires calling @{method:setViewer} in
- * advance due to the separate query.
*/
public function withRepositoryPHIDs(array $phids) {
- $repositories = id (new PhabricatorRepositoryQuery())
- ->setViewer($this->getViewer())
- ->withPHIDs($phids)
- ->execute();
-
- if (!$repositories) {
- throw new PhabricatorEmptyQueryException();
- }
- $this->withRepositoryIDs(mpull($repositories, 'getID'));
+ $this->repositoryPHIDs = $phids;
}
/**
@@ -282,6 +273,22 @@
private function buildWhereClause(AphrontDatabaseConnection $conn_r) {
$where = array();
+ if ($this->repositoryPHIDs !== null) {
+ $map_repositories = id (new PhabricatorRepositoryQuery())
+ ->setViewer($this->getViewer())
+ ->withPHIDs($this->repositoryPHIDs)
+ ->execute();
+
+ if (!$map_repositories) {
+ throw new PhabricatorEmptyQueryException();
+ }
+ $repository_ids = mpull($map_repositories, 'getID');
+ if ($this->repositoryIDs !== null) {
+ $repository_ids = array_merge($repository_ids, $this->repositoryIDs);
+ }
+ $this->withRepositoryIDs($repository_ids);
+ }
+
if ($this->ids !== null) {
$where[] = qsprintf(
$conn_r,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 10, 11:29 AM (1 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6743485
Default Alt Text
D10268.id.diff (2 KB)
Attached To
Mode
D10268: DiffusionCommitQuery - move phid to id mapping
Attached
Detach File
Event Timeline
Log In to Comment