1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-30 10: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:
Alan Huang 2012-07-05 16:47:04 -07:00
parent 78d2f08fcd
commit 731e0df2b5

View file

@ -29,7 +29,8 @@ final class ConduitAPI_differential_createcomment_Method
public function defineParamTypes() { public function defineParamTypes() {
return array( return array(
'revision_id' => 'required revisionid', '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, PhabricatorContentSource::SOURCE_CONDUIT,
array()); array());
$action = $request->getValue('action');
if (!$action) {
$action = 'none';
}
$editor = new DifferentialCommentEditor( $editor = new DifferentialCommentEditor(
$revision, $revision,
$request->getUser()->getPHID(), $request->getUser()->getPHID(),
DifferentialAction::ACTION_COMMENT); $action);
$editor->setContentSource($content_source); $editor->setContentSource($content_source);
$editor->setMessage($request->getValue('message')); $editor->setMessage($request->getValue('message'));
$editor->save(); $editor->save();