Implement generalized application search in Macros

Summary: Ref T2625. Works out the last kinks of generalization and gives Macros the more powerful new query engine. Overall, this feels pretty good to me.

Test Plan: Executed, saved and edited a bunch of Macro queries.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2625

Differential Revision: https://secure.phabricator.com/D6078
This commit is contained in:
epriestley
2013-05-30 14:09:37 -07:00
parent 5d94a8a338
commit d82e135cde
9 changed files with 226 additions and 151 deletions

View File

@@ -20,14 +20,6 @@ final class PhabricatorPasteSearchEngine
'authorPHIDs',
array_values($request->getArr('authors')));
try {
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
$saved->save();
unset($unguarded);
} catch (AphrontQueryDuplicateKeyException $ex) {
// Ignore, this is just a repeated search.
}
return $saved;
}
@@ -39,6 +31,7 @@ final class PhabricatorPasteSearchEngine
*/
public function buildQueryFromSavedQuery(PhabricatorSavedQuery $saved) {
$query = id(new PhabricatorPasteQuery())
->needContent(true)
->withIDs($saved->getParameter('ids', array()))
->withPHIDs($saved->getParameter('phids', array()))
->withAuthorPHIDs($saved->getParameter('authorPHIDs', array()))