Page MenuHomePhabricator

Move Mercurial discovery to PhabricatorRepositoryDiscoveryEngine
ClosedPublic

Authored by epriestley on Nov 6 2013, 6:57 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 12, 8:18 AM
Unknown Object (File)
Wed, Apr 10, 6:04 PM
Unknown Object (File)
Fri, Apr 5, 2:21 PM
Unknown Object (File)
Mar 19 2024, 1:37 AM
Unknown Object (File)
Feb 9 2024, 8:33 AM
Unknown Object (File)
Feb 4 2024, 12:28 PM
Unknown Object (File)
Feb 1 2024, 5:23 AM
Unknown Object (File)
Dec 23 2023, 11:02 AM
Subscribers

Details

Summary

Ref T4068. Partly, this moves discovery to the more unit-testable PhabricatorRepositoryDiscoveryEngine. It also fixes some issues, see inlines.

Test Plan

In a Mercurial repository, ran bin/repository discover --repair, verified commits came out topographically sorted. Ran without --repair and in various other contexts, like with no commits to discover and some-but-not-all commits to discover.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php
790–798

This is a bug. Commits are not inserted in topographical order, or even sort-of-topographical order. Instead, they're inserted in roughly-newest-to-oldest order, which is extremely bad and means we can't recover if we die halfway through. This is the primary issue this diff fixes. Discovery is fully safe and resumable if ancestors are always inserted before children.

src/applications/repository/engine/PhabricatorRepositoryDiscoveryEngine.php
46–52

Git is a bit more ocmplicated so I haven't moved it over yet.

228–243

Thanks for writing this, it made my job a lot easier. :)

btrahan added inline comments.
src/applications/repository/engine/PhabricatorRepositoryDiscoveryEngine.php
228–243

NP :D