{"record":{"id":"d4acb70a0422f983","repo":"phacility/phabricator","slug":"specify-one-or-more-repositories-to-mark-imported","errorCode":null,"errorMessage":"Specify one or more repositories to mark imported.","messagePattern":"Specify one or more repositories to mark imported\\.","errorType":"exception","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"error","filePath":"src/applications/repository/management/PhabricatorRepositoryManagementMarkImportedWorkflow.php","lineNumber":28,"sourceCode":"      ->setSynopsis(pht('Mark __repository__ as imported.'))\n      ->setArguments(\n        array(\n          array(\n            'name'        => 'mark-not-imported',\n            'help'        => pht('Instead, mark repositories as NOT imported.'),\n          ),\n          array(\n            'name'        => 'repos',\n            'wildcard'    => true,\n          ),\n        ));\n  }\n\n  public function execute(PhutilArgumentParser $args) {\n    $repos = $this->loadRepositories($args, 'repos');\n\n    if (!$repos) {\n      throw new PhutilArgumentUsageException(\n        pht('Specify one or more repositories to mark imported.'));\n    }\n\n    $new_importing_value = (bool)$args->getArg('mark-not-imported');\n\n    $console = PhutilConsole::getConsole();\n    foreach ($repos as $repo) {\n      $name = $repo->getDisplayName();\n\n      if ($repo->isImporting() && $new_importing_value) {\n        $console->writeOut(\n          \"%s\\n\",\n          pht(\n            'Repository \"%s\" is already importing.',\n            $name));\n      } else if (!$repo->isImporting() && !$new_importing_value) {\n        $console->writeOut(\n          \"%s\\n\",","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/repository/management/PhabricatorRepositoryManagementMarkImportedWorkflow.php#L10-L46","documentation":"Usage error from `bin/repository mark-imported`: the `repos` wildcard argument resolved to no repositories. The workflow forcibly flips the importing flag on repository objects (optionally back with `--mark-not-imported`), so it requires an explicit target list to avoid mass state changes.","triggerScenarios":"Running `./bin/repository mark-imported` bare; passing only `--mark-not-imported` with no repos; identifiers that resolve to nothing.","commonSituations":"After an import stuck at 99%, operators run the command without specifying which repo; copy-paste loses the trailing callsigns.","solutions":["Pass repository callsigns/IDs: `./bin/repository mark-imported R1`.","Double-check callsigns resolve (Diffusion or `./bin/repository list`) if arguments were supplied but ignored.","To revert a mistaken mark, run `./bin/repository mark-imported R1 --mark-not-imported`."],"exampleFix":"// before\n$ ./bin/repository mark-imported\n[1173] Specify one or more repositories to mark imported.\n\n// after\n$ ./bin/repository mark-imported R1","handlingStrategy":"validation","validationCode":"[ $# -ge 1 ] || { echo 'usage: mark-imported <callsign>... [--mark-not-imported]' >&2; exit 1; }\n./bin/repository mark-imported \"$@\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always name the target repositories; this tool force-sets import state, so avoid accidental global scope.","Know the undo flag (--mark-not-imported) before using it."],"tags":["phabricator","phorge","cli","usage-error","missing-argument","import"],"backgroundTag":"missing-required-argument","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}