phacility/phabricator · warning · PhabricatorSearchConstraintException

Subversion does not support searching for ancestors of a par

Error message

Subversion does not support searching for ancestors of a particular ref. This operation is not meaningful in Subversion.

What it means

The ancestors-of-refs search relies on a DAG-shaped history (git-style branch graphs). Subversion's model is a single linear rN sequence with no ref DAG, so the operation is not meaningful there; Phabricator raises PhabricatorSearchConstraintException to block the combination instead of pretending to answer.

Source

Thrown at src/applications/diffusion/query/DiffusionCommitQuery.php:575

            'To search for commits which are ancestors of particular refs, '.
            'you must constrain the search to exactly one repository.'));
      }

      $repository_id = head($this->repositoryIDs);
      $history_limit = $this->getRawResultLimit() * 32;
      $viewer = $this->getViewer();

      $repository = id(new PhabricatorRepositoryQuery())
        ->setViewer($viewer)
        ->withIDs(array($repository_id))
        ->executeOne();

      if (!$repository) {
        throw new PhabricatorEmptyQueryException();
      }

      if ($repository->isSVN()) {
        throw new PhabricatorSearchConstraintException(
          pht(
            'Subversion does not support searching for ancestors of '.
            'a particular ref. This operation is not meaningful in '.
            'Subversion.'));
      }

      if ($repository->isHg()) {
        throw new PhabricatorSearchConstraintException(
          pht(
            'Mercurial does not currently support searching for ancestors of '.
            'a particular ref.'));
      }

      $can_constrain = true;
      $history_identifiers = array();
      foreach ($this->ancestorsOf as $key => $ref) {
        try {
          $raw_history = DiffusionQuery::callConduitWithDiffusionRequest(

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Remove the ancestors-of-refs constraint when searching SVN repositories
  2. Express 'history reachable from a revision' in SVN terms instead: filter by path and revision range
  3. Guard shared query code so the ancestor filter is only applied for git repositories
Defensive patterns

Strategy: validation

Validate before calling

if ($repository->isSVN()) {
  // hide or reject the ancestors-of filter for this repository
}

Type guard

function supportsAncestorSearch(PhabricatorRepository $repository) {
  return !$repository->isSVN();
}

Try / catch

try {
  $results = $query->execute();
} catch (PhabricatorSearchConstraintException $ex) {
  // explain that SVN has no ref DAG; suggest path + revision filters
}

Prevention

When it happens

Trigger: A commit search includes ancestorsOf and is constrained to exactly one repository, but that repository is a Subversion repository.

Common situations: Generic saved queries, dashboards, or API code written against git repositories reused unchanged on SVN repositories.

Related errors


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