3 final class PhabricatorRepositoryManagementMarkImportedWorkflow
4 extends PhabricatorRepositoryManagementWorkflow
{
6 protected function didConstruct() {
8 ->setName('mark-imported')
9 ->setExamples('**mark-imported** __repository__ ...')
10 ->setSynopsis(pht('Mark __repository__ as imported.'))
14 'name' => 'mark-not-imported',
15 'help' => pht('Instead, mark repositories as NOT imported.'),
24 public function execute(PhutilArgumentParser
$args) {
25 $repos = $this->loadRepositories($args, 'repos');
28 throw new PhutilArgumentUsageException(
29 pht('Specify one or more repositories to mark imported.'));
32 $new_importing_value = (bool)$args->getArg('mark-not-imported');
34 $console = PhutilConsole
::getConsole();
35 foreach ($repos as $repo) {
36 $name = $repo->getDisplayName();
38 if ($repo->isImporting() && $new_importing_value) {
42 'Repository "%s" is already importing.',
44 } else if (!$repo->isImporting() && !$new_importing_value) {
48 'Repository "%s" is already imported.',
51 if ($new_importing_value) {
55 'Marking repository "%s" as importing.',
61 'Marking repository "%s" as imported.',
65 $repo->setDetail('importing', $new_importing_value);
70 $console->writeOut("%s\n", pht('Done.'));