Diffusion - move DiffQuery to Conduit
Summary: title does not say it all; also added conduit wrappers for rawdiffquery and lastmodifiedquery. These get the wrapper treatment since they are used in daemons. Ref T2784. Test Plan: for each of the 3 VCS, did the following: 1) loaded up CALLSIGN and verified 'Modified' column data showed up correctly in Browse Repository box. 2) loaded up the "change" view for a specific file and verified content showed up correctly. 3) loaded up a specific commit and noted the changes ajax loaded A-OK Reviewers: epriestley Reviewed By: epriestley CC: chad, aran, Korvin Maniphest Tasks: T2784 Differential Revision: https://secure.phabricator.com/D5896
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @group conduit
|
||||
*/
|
||||
final class ConduitAPI_diffusion_rawdiffquery_Method
|
||||
extends ConduitAPI_diffusion_abstractquery_Method {
|
||||
|
||||
public function getMethodDescription() {
|
||||
return
|
||||
'Get raw diff information from a repository for a specific commit at an '.
|
||||
'(optional) path.';
|
||||
}
|
||||
|
||||
public function defineReturnType() {
|
||||
return 'string';
|
||||
}
|
||||
|
||||
protected function defineCustomParamTypes() {
|
||||
return array(
|
||||
'commit' => 'required string',
|
||||
'path' => 'optional string',
|
||||
'timeout' => 'optional int',
|
||||
'linesOfContext' => 'optional int',
|
||||
'againstCommit' => 'optional string',
|
||||
);
|
||||
}
|
||||
|
||||
protected function getResult(ConduitAPIRequest $request) {
|
||||
$drequest = $this->getDiffusionRequest();
|
||||
$timeout = $request->getValue('timeout');
|
||||
$lines_of_context = $request->getValue('linesOfContext');
|
||||
$against_commit = $request->getValue('againstCommit');
|
||||
|
||||
$raw_query = DiffusionRawDiffQuery::newFromDiffusionRequest($drequest);
|
||||
if ($timeout !== null) {
|
||||
$raw_query->setTimeout($timeout);
|
||||
}
|
||||
if ($lines_of_context !== null) {
|
||||
$raw_query->setLinesOfContext($lines_of_context);
|
||||
}
|
||||
if ($against_commit !== null) {
|
||||
$raw_query->setAgainstCommit($against_commit);
|
||||
}
|
||||
return $raw_query->loadRawDiff();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user