Add "diffusion.commit.edit", a v3 edit API endpoint for commits
Summary: Ref T10978. This currently does almost nothing, but gets it in place so I can add stuff to it. Test Plan: Made a comment on a commit using the API. Reviewers: chad Reviewed By: chad Maniphest Tasks: T10978 Differential Revision: https://secure.phabricator.com/D17178
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
final class DiffusionCommitEditConduitAPIMethod
|
||||
extends PhabricatorEditEngineAPIMethod {
|
||||
|
||||
public function getAPIMethodName() {
|
||||
return 'diffusion.commit.edit';
|
||||
}
|
||||
|
||||
public function newEditEngine() {
|
||||
return new DiffusionCommitEditEngine();
|
||||
}
|
||||
|
||||
public function getMethodSummary() {
|
||||
return pht(
|
||||
'Apply transactions to edit an existing commit. This method can not '.
|
||||
'create new commits.');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -26,7 +26,16 @@ final class DiffusionCommitEditEngine
|
||||
}
|
||||
|
||||
protected function newEditableObject() {
|
||||
throw new PhutilMethodNotImplementedException();
|
||||
// NOTE: We must return a valid object here so that things like Conduit
|
||||
// documentation generation work. You can't actually create commits via
|
||||
// EditEngine. This is enforced with a "No One" creation policy.
|
||||
|
||||
$repository = new PhabricatorRepository();
|
||||
$data = new PhabricatorRepositoryCommitData();
|
||||
|
||||
return id(new PhabricatorRepositoryCommit())
|
||||
->attachRepository($repository)
|
||||
->attachCommitData($data);
|
||||
}
|
||||
|
||||
protected function newObjectQuery() {
|
||||
|
||||
Reference in New Issue
Block a user