[ Index ] |
PHP Cross Reference of Phabricator |
[Summary view] [Print] [Text view]
1 <?php 2 3 abstract class PhabricatorRepositoryManagementWorkflow 4 extends PhabricatorManagementWorkflow { 5 6 protected function loadRepositories(PhutilArgumentParser $args, $param) { 7 $callsigns = $args->getArg($param); 8 9 if (!$callsigns) { 10 return null; 11 } 12 13 $repos = id(new PhabricatorRepositoryQuery()) 14 ->setViewer($this->getViewer()) 15 ->withCallsigns($callsigns) 16 ->execute(); 17 18 $repos = mpull($repos, null, 'getCallsign'); 19 foreach ($callsigns as $callsign) { 20 if (empty($repos[$callsign])) { 21 throw new PhutilArgumentUsageException( 22 "No repository with callsign '{$callsign}' exists!"); 23 } 24 } 25 26 return $repos; 27 } 28 29 protected function loadCommits(PhutilArgumentParser $args, $param) { 30 $names = $args->getArg($param); 31 if (!$names) { 32 return null; 33 } 34 35 return $this->loadNamedCommits($names); 36 } 37 38 protected function loadNamedCommit($name) { 39 $map = $this->loadNamedCommits(array($name)); 40 return $map[$name]; 41 } 42 43 protected function loadNamedCommits(array $names) { 44 $query = id(new DiffusionCommitQuery()) 45 ->setViewer($this->getViewer()) 46 ->withIdentifiers($names); 47 48 $query->execute(); 49 $map = $query->getIdentifierMap(); 50 51 foreach ($names as $name) { 52 if (empty($map[$name])) { 53 throw new PhutilArgumentUsageException( 54 pht('Commit "%s" does not exist or is ambiguous.', $name)); 55 } 56 } 57 58 return $map; 59 } 60 61 62 }
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 |