[ Index ] |
PHP Cross Reference of Phabricator |
[Summary view] [Print] [Text view]
1 <?php 2 3 final class ReleephWorkGetBranchConduitAPIMethod 4 extends ReleephConduitAPIMethod { 5 6 public function getAPIMethodName() { 7 return 'releephwork.getbranch'; 8 } 9 10 public function getMethodStatus() { 11 return self::METHOD_STATUS_UNSTABLE; 12 } 13 14 public function getMethodDescription() { 15 return 'Return information to help checkout / cut a Releeph branch.'; 16 } 17 18 public function defineParamTypes() { 19 return array( 20 'branchPHID' => 'required string', 21 ); 22 } 23 24 public function defineReturnType() { 25 return 'dict<string, wild>'; 26 } 27 28 public function defineErrorTypes() { 29 return array(); 30 } 31 32 protected function execute(ConduitAPIRequest $request) { 33 $branch = id(new ReleephBranchQuery()) 34 ->setViewer($request->getUser()) 35 ->withPHIDs(array($request->getValue('branchPHID'))) 36 ->needCutPointCommits(true) 37 ->executeOne(); 38 39 $cut_phid = $branch->getCutPointCommitPHID(); 40 $phids = array($cut_phid); 41 $handles = id(new PhabricatorHandleQuery()) 42 ->setViewer($request->getUser()) 43 ->withPHIDs($phids) 44 ->execute(); 45 46 $project = $branch->getProject(); 47 $repo = $project->getRepository(); 48 $commit = $branch->getCutPointCommit(); 49 50 return array( 51 'branchName' => $branch->getName(), 52 'branchPHID' => $branch->getPHID(), 53 'vcsType' => $repo->getVersionControlSystem(), 54 'cutCommitID' => $commit->getCommitIdentifier(), 55 'cutCommitName' => $handles[$cut_phid]->getName(), 56 'creatorPHID' => $branch->getCreatedByUserPHID(), 57 'trunk' => $project->getTrunkBranch(), 58 ); 59 } 60 61 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Sun Nov 30 09:20:46 2014 | Cross-referenced by PHPXref 0.7.1 |