3 final class PhabricatorRepositoryManagementImportingWorkflow
4 extends PhabricatorRepositoryManagementWorkflow
{
6 protected function didConstruct() {
9 ->setExamples('**importing** __repository__ ...')
12 'Show commits in __repository__ which are still importing.'))
17 'help' => pht('Show simpler output.'),
26 public function execute(PhutilArgumentParser
$args) {
27 $repos = $this->loadRepositories($args, 'repos');
30 throw new PhutilArgumentUsageException(
32 'Specify one or more repositories to find importing commits for.'));
35 $repos = mpull($repos, null, 'getID');
37 $table = new PhabricatorRepositoryCommit();
38 $conn_r = $table->establishConnection('r');
42 'SELECT repositoryID, commitIdentifier, importStatus FROM %T
43 WHERE repositoryID IN (%Ld)
44 AND (importStatus & %d) != %d
45 AND (importStatus & %d) != %d',
46 $table->getTableName(),
48 PhabricatorRepositoryCommit
::IMPORTED_ALL
,
49 PhabricatorRepositoryCommit
::IMPORTED_ALL
,
50 PhabricatorRepositoryCommit
::IMPORTED_UNREACHABLE
,
51 PhabricatorRepositoryCommit
::IMPORTED_UNREACHABLE
);
53 $console = PhutilConsole
::getConsole();
55 foreach ($rows as $row) {
56 $repo = $repos[$row['repositoryID']];
57 $identifier = $row['commitIdentifier'];
59 $console->writeOut('%s', $repo->formatCommitName($identifier));
61 if (!$args->getArg('simple')) {
62 $status = $row['importStatus'];
64 if (!($status & PhabricatorRepositoryCommit
::IMPORTED_MESSAGE
)) {
65 $need[] = pht('Message');
67 if (!($status & PhabricatorRepositoryCommit
::IMPORTED_CHANGE
)) {
68 $need[] = pht('Change');
70 if (!($status & PhabricatorRepositoryCommit
::IMPORTED_PUBLISH
)) {
71 $need[] = pht('Publish');
74 $console->writeOut(' %s', implode(', ', $need));
77 $console->writeOut("\n");
82 pht('No importing commits found.'));