phacility/phabricator · error · PhutilArgumentUsageException

Only Git and Mercurial repositories are supported, unable to

Error message

Only Git and Mercurial repositories are supported, unable to operate on this repository ("%s").

What it means

Thrown by `bin/repository mark-reachable` inside `markReachable()` when a target repository is neither Git (`isGit()`) nor Mercurial (`isHg()`) — in practice, Subversion. The algorithm walks `DiffusionCommitQuery` results and rewrites `commitCoverage`/reachability storage whose semantics only exist for Git and Hg DAGs, so SVN is rejected before any commit processing.

Source

Thrown at src/applications/repository/management/PhabricatorRepositoryManagementMarkReachableWorkflow.php:52

      $this->markReachable($repo);
    }

    echo tsprintf(
      "%s\n",
      pht(
        'Examined %s commits already in the correct state.',
        new PhutilNumber($this->untouchedCount)));

    echo tsprintf(
      "%s\n",
      pht('Done.'));

    return 0;
  }

  private function markReachable(PhabricatorRepository $repository) {
    if (!$repository->isGit() && !$repository->isHg()) {
      throw new PhutilArgumentUsageException(
        pht(
          'Only Git and Mercurial repositories are supported, unable to '.
          'operate on this repository ("%s").',
          $repository->getDisplayName()));
    }

    $viewer = $this->getViewer();

    $commits = id(new DiffusionCommitQuery())
      ->setViewer($viewer)
      ->withRepository($repository)
      ->execute();

    $flag = PhabricatorRepositoryCommit::IMPORTED_UNREACHABLE;

    if ($repository->isGit()) {
      $graph = new PhabricatorGitGraphStream($repository);
    } else if ($repository->isHg()) {

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Restrict the command to Git/Mercurial repositories only.
  2. If scripting over all repos, filter out SVN first (check the repository VCS in Diffusion or via the API).
  3. For SVN data problems, use reparse/reimport tooling instead of mark-reachable.

Example fix

// before
$ ./bin/repository mark-reachable R1 R3   # R3 is SVN
[1175] Only Git and Mercurial repositories are supported ... ("rR3").

// after
$ ./bin/repository mark-reachable R1
Defensive patterns

Strategy: validation

Validate before calling

# Pre-filter to git/hg only
for r in R1 R3; do vcs=$(./bin/repository list --output json | jq -r --arg r "$r" '.[] | select(.callsign==$r) | .vcs'); { [ "$vcs" = git ] || [ "$vcs" = hg ]; } && ./bin/repository mark-reachable "$r"; done

Type guard

function is_reachable_capable(PhabricatorRepository $repository): bool {
  return $repository->isGit() || $repository->isHg();
}

Prevention

When it happens

Trigger: Running `./bin/repository mark-reachable R3` where R3 is an SVN repository; passing a wildcard list of all repositories that includes the SVN one — the exception aborts the run partway (repos processed before it are done).

Common situations: Mixed-VCS installations run reachability correction across every repo without filtering; SVN imports flagged unreachable commits and operators reach for this tool by analogy.

Related errors


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