{"record":{"id":"0d43dba3292d3804","repo":"phacility/phabricator","slug":"missing-commits-s-in-a-svn-repository-which-is","errorCode":null,"errorMessage":"Missing commits (%s) in a SVN repository which is not configured for subdirectory-only parsing!","messagePattern":"Missing commits \\((.+?)\\) in a SVN repository which is not configured for subdirectory-only parsing!","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/repository/worker/commitchangeparser/PhabricatorRepositorySvnCommitChangeParserWorker.php","lineNumber":507,"sourceCode":"\n    $commit_map = ipull($commit_data, 'id', 'commitIdentifier');\n\n    $need = array();\n    foreach ($commits as $commit) {\n      if (empty($commit_map[$commit])) {\n        $need[] = $commit;\n      }\n    }\n\n    // If we are parsing a Subversion repository and have been configured to\n    // import only some subdirectory of it, we may find commits which reference\n    // other foreign commits outside of the directory (for instance, because of\n    // a move or copy). Rather than trying to execute full parses on them, just\n    // create stub commits and identify the stubs as foreign commits.\n    if ($need) {\n      $subpath = $repository->getDetail('svn-subpath');\n      if (!$subpath) {\n        throw new Exception(\n          pht(\n            'Missing commits (%s) in a SVN repository which is not '.\n            'configured for subdirectory-only parsing!',\n            implode(', ', $need)));\n      }\n\n      foreach ($need as $foreign_commit) {\n        $commit = new PhabricatorRepositoryCommit();\n        $commit->setRepositoryID($repository->getID());\n        $commit->setCommitIdentifier($foreign_commit);\n        $commit->setEpoch(0);\n        // Mark this commit as imported so it doesn't prevent the repository\n        // from transitioning into the \"Imported\" state.\n        $commit->setImportStatus(PhabricatorRepositoryCommit::IMPORTED_ALL);\n        $commit->save();\n\n        $data = new PhabricatorRepositoryCommitData();\n        $data->setCommitID($commit->getID());","sourceCodeStart":489,"sourceCodeEnd":525,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/repository/worker/commitchangeparser/PhabricatorRepositorySvnCommitChangeParserWorker.php#L489-L525","documentation":"After parsing SVN changes, the parser may need to reference commits outside the discovered set (from copies/moves across directories). That is only supported when the repository detail 'svn-subpath' is configured for subdirectory-only import, in which case foreign commits become stub rows; without it, missing commits are fatal (PhabricatorRepositorySvnCommitChangeParserWorker.php:507-517).","triggerScenarios":"Importing only part of an SVN repository without setting the subdirectory detail, where commits contain copies from paths outside the imported subtree; or removing/altering the svn-subpath detail after the import started.","commonSituations":"Carving trunk-only or project-subdirectory imports out of large SVN repositories; repository layout migrations that change the subpath configuration mid-import.","solutions":["Set the repository's subdirectory import detail ('Import Only: <path>') to match the subtree actually being imported","Or import the full repository so every referenced commit is discovered","Re-run discovery and parsing after the configuration change"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// If importing a subtree, ensure the subpath detail is set before parsing.\nif ($repository->getVersionControlSystem() === PhabricatorRepositoryType::REPOSITORY_TYPE_SVN\n    && !$repository->getDetail('svn-subpath')) {\n  // importing only part of this repo will fail on cross-directory copies;\n  // set the 'Import Only' detail or import everything\n}","typeGuard":null,"tryCatchPattern":"try {\n  $this->resolveMissingSVNCommits($repository, $need);\n} catch (Exception $ex) {\n  // Missing foreign commits without subdirectory config: fix the\n  // repository's svn-subpath detail or import the full repository, then\n  // rediscover; a retry before that fails identically.\n  phlog($ex);\n  throw new PhabricatorWorkerPermanentFailureException($ex->getMessage());\n}","preventionTips":["When importing a subdirectory of an SVN repo, always configure the matching 'Import Only' path","Do not change or clear svn-subpath mid-import","For full-repo imports, ensure discovery has covered all revisions referenced by copies"],"tags":["phabricator","svn","partial-import","subdirectory","configuration","php"],"backgroundTag":"partial-import-incomplete-history","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}