[ Index ] |
PHP Cross Reference of Phabricator |
[Summary view] [Print] [Text view]
1 <?php 2 3 final class PhabricatorRepositoryManagementImportingWorkflow 4 extends PhabricatorRepositoryManagementWorkflow { 5 6 public function didConstruct() { 7 $this 8 ->setName('importing') 9 ->setExamples('**importing** __repository__ ...') 10 ->setSynopsis( 11 'Show commits in __repository__, named by callsign, which are still '. 12 'importing.') 13 ->setArguments( 14 array( 15 array( 16 'name' => 'simple', 17 'help' => 'Show simpler output.', 18 ), 19 array( 20 'name' => 'repos', 21 'wildcard' => true, 22 ), 23 )); 24 } 25 26 public function execute(PhutilArgumentParser $args) { 27 $repos = $this->loadRepositories($args, 'repos'); 28 29 if (!$repos) { 30 throw new PhutilArgumentUsageException( 31 'Specify one or more repositories to find importing commits for, '. 32 'by callsign.'); 33 } 34 35 $repos = mpull($repos, null, 'getID'); 36 37 $table = new PhabricatorRepositoryCommit(); 38 $conn_r = $table->establishConnection('r'); 39 40 $rows = queryfx_all( 41 $conn_r, 42 'SELECT repositoryID, commitIdentifier, importStatus FROM %T 43 WHERE repositoryID IN (%Ld) AND (importStatus & %d) != %d', 44 $table->getTableName(), 45 array_keys($repos), 46 PhabricatorRepositoryCommit::IMPORTED_ALL, 47 PhabricatorRepositoryCommit::IMPORTED_ALL); 48 49 $console = PhutilConsole::getConsole(); 50 if ($rows) { 51 foreach ($rows as $row) { 52 $repo = $repos[$row['repositoryID']]; 53 $identifier = $row['commitIdentifier']; 54 55 $console->writeOut('%s', 'r'.$repo->getCallsign().$identifier); 56 57 if (!$args->getArg('simple')) { 58 $status = $row['importStatus']; 59 $need = array(); 60 if (!($status & PhabricatorRepositoryCommit::IMPORTED_MESSAGE)) { 61 $need[] = 'Message'; 62 } 63 if (!($status & PhabricatorRepositoryCommit::IMPORTED_CHANGE)) { 64 $need[] = 'Change'; 65 } 66 if (!($status & PhabricatorRepositoryCommit::IMPORTED_OWNERS)) { 67 $need[] = 'Owners'; 68 } 69 if (!($status & PhabricatorRepositoryCommit::IMPORTED_HERALD)) { 70 $need[] = 'Herald'; 71 } 72 73 $console->writeOut(' %s', implode(', ', $need)); 74 } 75 76 $console->writeOut("\n"); 77 } 78 } else { 79 $console->writeErr( 80 "%s\n", 81 pht('No importing commits found.')); 82 } 83 84 return 0; 85 } 86 87 }
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 |