Path: blob/master/src/applications/differential/conduit/DifferentialGetCommitPathsConduitAPIMethod.php
12256 views
<?php12final class DifferentialGetCommitPathsConduitAPIMethod3extends DifferentialConduitAPIMethod {45public function getAPIMethodName() {6return 'differential.getcommitpaths';7}89public function getMethodDescription() {10return pht(11'Query which paths should be included when committing a '.12'Differential revision.');13}1415protected function defineParamTypes() {16return array(17'revision_id' => 'required int',18);19}2021protected function defineReturnType() {22return 'nonempty list<string>';23}2425protected function defineErrorTypes() {26return array(27'ERR_NOT_FOUND' => pht('No such revision exists.'),28);29}3031protected function execute(ConduitAPIRequest $request) {32$id = $request->getValue('revision_id');3334$revision = id(new DifferentialRevisionQuery())35->setViewer($request->getUser())36->withIDs(array($id))37->executeOne();38if (!$revision) {39throw new ConduitException('ERR_NOT_FOUND');40}4142$paths = array();43$diff = id(new DifferentialDiff())->loadOneWhere(44'revisionID = %d ORDER BY id DESC limit 1',45$revision->getID());4647$diff->attachChangesets($diff->loadChangesets());4849foreach ($diff->getChangesets() as $changeset) {50$paths[] = $changeset->getFilename();51}5253return $paths;54}5556}575859