phacility/phabricator · error · Exception

No commit "%s" in this repository.

Error message

No commit "%s" in this repository.

What it means

DiffusionLowLevelParentsQuery::loadSubversionParents first resolves the requested revision identifier through DiffusionCachedResolveRefsQuery. For Subversion, identifiers are revision numbers; if the identifier resolves to no known commit in that repository, the cached lookup returns nothing and this exception reports the missing commit.

Source

Thrown at src/applications/diffusion/query/lowlevel/DiffusionLowLevelParentsQuery.php:83

      // missing parents; ignore it.
      if (preg_match('/^0+\z/', $value)) {
        unset($hashes[$key]);
      }
    }

    return $hashes;
  }

  private function loadSubversionParents() {
    $repository = $this->getRepository();
    $identifier = $this->identifier;

    $refs = id(new DiffusionCachedResolveRefsQuery())
      ->setRepository($repository)
      ->withRefs(array($identifier))
      ->execute();
    if (!$refs) {
      throw new Exception(
        pht(
          'No commit "%s" in this repository.',
          $identifier));
    }

    $n = (int)$identifier;
    if ($n > 1) {
      $ids = array($n - 1);
    } else {
      $ids = array();
    }

    return $ids;
  }

}

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Confirm the revision exists in the repository itself: svn log -r <n> <repository-uri>
  2. Force discovery forward: bin/repository update <callsign>, or wait for/poke the repository daemon
  3. Verify you resolved the correct repository (callsign routing), especially with multiple SVN repos
  4. If the repository is empty, make the first commit or let the initial import finish
Defensive patterns

Strategy: validation

Validate before calling

// Resolve the identifier before asking for parents
$refs = id(new DiffusionCachedResolveRefsQuery())
  ->setRepository($repository)
  ->withRefs(array($identifier))
  ->execute();
if (empty($refs[$identifier])) {
  // render a 404 'revision not found' response instead of throwing
}

Type guard

function isSvnRevisionIdentifier($raw) {
  return (bool)preg_match('/^r?[1-9][0-9]*$/', trim($raw));
}

Try / catch

try {
  $parents = id(new DiffusionLowLevelParentsQuery())
    ->setRepository($repository)
    ->withIdentifier($identifier)
    ->execute();
} catch (Exception $ex) {
  if (preg_match('/^No commit /', $ex->getMessage())) {
    return new Aphront404Response();
  }
  throw $ex;
}

Prevention

When it happens

Trigger: Calling the parents query (commit page or history rendering) for an SVN revision that does not exist: a revision number beyond HEAD, a typo like r99999, a Git-style hash passed to an SVN repository, or a revision the importer has not discovered yet.

Common situations: Newly created hosted SVN repositories with zero commits; imports still in progress; interrupted svnadmin load; external tracker links pointing at revisions that were never loaded.

Related errors


AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21). Data as JSON: /api/errors/c79009ed3cb9934f. Report an issue: GitHub.