@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3final class DiffusionCommitParentsQueryConduitAPIMethod
4 extends DiffusionQueryConduitAPIMethod {
5
6 public function getAPIMethodName() {
7 return 'diffusion.commitparentsquery';
8 }
9
10 public function getMethodDescription() {
11 return pht(
12 "Get the commit identifiers for a commit's parent or parents.");
13 }
14
15 protected function defineReturnType() {
16 return 'list<string>';
17 }
18
19 protected function defineCustomParamTypes() {
20 return array(
21 'commit' => 'required string',
22 );
23 }
24
25 protected function getResult(ConduitAPIRequest $request) {
26 $repository = $this->getRepository($request);
27
28 return id(new DiffusionLowLevelParentsQuery())
29 ->setRepository($repository)
30 ->withIdentifier($request->getValue('commit'))
31 ->execute();
32 }
33
34}