mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 00:42:41 +01:00
Add a differential.abandon Conduit method.
Summary: Brazenly copied from differential.close. Ulterior motive is to be able to automate discarding of useless commits from arcanist testing. Test Plan: Called method in phabricator sandbox. Revisions were successfully abandoned. Reviewers: epriestley Reviewed By: epriestley CC: nh, aran, Korvin Differential Revision: https://secure.phabricator.com/D2928
This commit is contained in:
parent
78d2f08fcd
commit
731e0df2b5
1 changed files with 8 additions and 2 deletions
|
@ -29,7 +29,8 @@ final class ConduitAPI_differential_createcomment_Method
|
|||
public function defineParamTypes() {
|
||||
return array(
|
||||
'revision_id' => 'required revisionid',
|
||||
'message' => 'required string',
|
||||
'message' => 'optional string',
|
||||
'action' => 'optional string',
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -54,10 +55,15 @@ final class ConduitAPI_differential_createcomment_Method
|
|||
PhabricatorContentSource::SOURCE_CONDUIT,
|
||||
array());
|
||||
|
||||
$action = $request->getValue('action');
|
||||
if (!$action) {
|
||||
$action = 'none';
|
||||
}
|
||||
|
||||
$editor = new DifferentialCommentEditor(
|
||||
$revision,
|
||||
$request->getUser()->getPHID(),
|
||||
DifferentialAction::ACTION_COMMENT);
|
||||
$action);
|
||||
$editor->setContentSource($content_source);
|
||||
$editor->setMessage($request->getValue('message'));
|
||||
$editor->save();
|
||||
|
|
Loading…
Reference in a new issue