Diffusion - move DiffusionExistsQuery to work over conduit

Summary: le title. However, this also "is the first" conversion so sets the precedence for how this will all work. See comments in the code. I think this helps us keep the new code we're writing to a minimum. Wondering if the conduit end point could be more generic, and rather than have a switch statement on VCS type, one can just implement the "handleSubversion" version and have that called?  Ref T2784

Test Plan: slapped an "or true" in the conditional protecting this code path. verified it worked on all 3 vcs systems, including typing in garbage and getting a 404

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2784

Differential Revision: https://secure.phabricator.com/D5803
This commit is contained in:
Bob Trahan
2013-05-01 14:44:28 -07:00
parent ea78f920dd
commit c79d26144a
10 changed files with 197 additions and 78 deletions

View File

@@ -36,6 +36,27 @@ abstract class DiffusionQuery extends PhabricatorQuery {
return $this->request;
}
final public static function callConduitWithDiffusionRequest(
PhabricatorUser $user,
DiffusionRequest $drequest,
$method,
array $params = array()) {
$repository = $drequest->getRepository();
$core_params = array(
'callsign' => $repository->getCallsign()
);
$params = $params + $core_params;
return id(new ConduitCall(
$method,
$params
))
->setUser($user)
->execute();
}
public function execute() {
return $this->executeQuery();
}