2013-05-14 13:53:32 -07:00
|
|
|
<?php
|
|
|
|
|
Rename Conduit classes
Summary: Ref T5655. Rename Conduit classes and provide a `getAPIMethodName` method to declare the API method.
Test Plan:
```
> echo '{}' | arc --conduit-uri='http://phabricator.joshuaspence.com' call-conduit user.whoami
Waiting for JSON parameters on stdin...
{"error":null,"errorMessage":null,"response":{"phid":"PHID-USER-lioqffnwn6y475mu5ndb","userName":"josh","realName":"Joshua Spence","image":"http:\/\/phabricator.joshuaspence.com\/res\/1404425321T\/phabricator\/3eb28cd9\/rsrc\/image\/avatar.png","uri":"http:\/\/phabricator.joshuaspence.com\/p\/josh\/","roles":["admin","verified","approved","activated"]}}
```
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: epriestley, Korvin, hach-que
Maniphest Tasks: T5655
Differential Revision: https://secure.phabricator.com/D9991
2014-07-25 10:54:15 +10:00
|
|
|
final class DiffusionRawDiffQueryConduitAPIMethod
|
|
|
|
extends DiffusionQueryConduitAPIMethod {
|
|
|
|
|
|
|
|
public function getAPIMethodName() {
|
|
|
|
return 'diffusion.rawdiffquery';
|
|
|
|
}
|
2013-05-14 13:53:32 -07:00
|
|
|
|
|
|
|
public function getMethodDescription() {
|
2015-05-22 17:27:56 +10:00
|
|
|
return pht(
|
2013-05-14 13:53:32 -07:00
|
|
|
'Get raw diff information from a repository for a specific commit at an '.
|
2015-05-22 17:27:56 +10:00
|
|
|
'(optional) path.');
|
2013-05-14 13:53:32 -07:00
|
|
|
}
|
|
|
|
|
2015-04-12 15:59:07 -07:00
|
|
|
protected function defineReturnType() {
|
2013-05-14 13:53:32 -07:00
|
|
|
return 'string';
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function defineCustomParamTypes() {
|
|
|
|
return array(
|
|
|
|
'commit' => 'required string',
|
|
|
|
'path' => 'optional string',
|
|
|
|
'linesOfContext' => 'optional int',
|
|
|
|
'againstCommit' => 'optional string',
|
2016-08-26 09:37:53 -07:00
|
|
|
) + DiffusionFileFutureQuery::getConduitParameters();
|
2013-05-14 13:53:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
protected function getResult(ConduitAPIRequest $request) {
|
|
|
|
$drequest = $this->getDiffusionRequest();
|
|
|
|
|
2016-08-26 09:37:53 -07:00
|
|
|
$query = DiffusionRawDiffQuery::newFromDiffusionRequest($drequest);
|
2014-01-03 12:27:19 -08:00
|
|
|
|
|
|
|
$lines_of_context = $request->getValue('linesOfContext');
|
2013-05-14 13:53:32 -07:00
|
|
|
if ($lines_of_context !== null) {
|
2016-08-26 09:37:53 -07:00
|
|
|
$query->setLinesOfContext($lines_of_context);
|
2013-05-14 13:53:32 -07:00
|
|
|
}
|
2014-01-03 12:27:19 -08:00
|
|
|
|
|
|
|
$against_commit = $request->getValue('againstCommit');
|
2013-05-14 13:53:32 -07:00
|
|
|
if ($against_commit !== null) {
|
2016-08-26 09:37:53 -07:00
|
|
|
$query->setAgainstCommit($against_commit);
|
2014-01-03 12:27:19 -08:00
|
|
|
}
|
|
|
|
|
2016-08-26 09:37:53 -07:00
|
|
|
return $query->respondToConduitRequest($request);
|
2013-05-14 13:53:32 -07:00
|
|
|
}
|
Rename Conduit classes
Summary: Ref T5655. Rename Conduit classes and provide a `getAPIMethodName` method to declare the API method.
Test Plan:
```
> echo '{}' | arc --conduit-uri='http://phabricator.joshuaspence.com' call-conduit user.whoami
Waiting for JSON parameters on stdin...
{"error":null,"errorMessage":null,"response":{"phid":"PHID-USER-lioqffnwn6y475mu5ndb","userName":"josh","realName":"Joshua Spence","image":"http:\/\/phabricator.joshuaspence.com\/res\/1404425321T\/phabricator\/3eb28cd9\/rsrc\/image\/avatar.png","uri":"http:\/\/phabricator.joshuaspence.com\/p\/josh\/","roles":["admin","verified","approved","activated"]}}
```
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: epriestley, Korvin, hach-que
Maniphest Tasks: T5655
Differential Revision: https://secure.phabricator.com/D9991
2014-07-25 10:54:15 +10:00
|
|
|
|
2013-05-14 13:53:32 -07:00
|
|
|
}
|