HomePhabricator

Add support to marking commits as UNREACHABLE for Mercurial

Description

Add support to marking commits as UNREACHABLE for Mercurial

Summary:
When previously known commits have been destroyed in a Mercurial repository, Phabricator does not end up marking the commits as unreachable. This results in daemon tasks which continuously fail and retry.

This updates PhabricatorRepositoryDiscoveryEngine and PhabricatorManagementRepositoryMarkReachableWorkflow to include support of marking commits as unreachable for Mercurial repositories.

The PhabricatorMercurialGraphStream also needed updated to support a stream with no starting commit.

Refs T13634

Test Plan:

  1. I set up a hosted Mercurial repository.
  2. I removed the head commit from the on-disk repository state.
  3. I attempted to load the repository page and saw an exception due to a missing commit.
  4. I went to /manage for the repository and scheduled an update of the repository.
  5. After an updated performed, I went to the repository main page and saw there was no exception and the history view properly did not have the commit I had removed.
  6. I checked the phd logs and verified there were no exceptions related to the repository.
  7. I ran the ./bin/repository mark-reachable command on the Mercurial repository and it reported that it marked the commit as unreachable.
  8. I pushed the same commit back upstream and verified that the commit was found and displayed in the history view of the repository page and mark-unreachable did not identify it as being unreachable.

Reviewers: Blessed Reviewers, epriestley

Reviewed By: Blessed Reviewers, epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T13634

Differential Revision: https://secure.phabricator.com/D21715