Page MenuHomePhabricator

Move Mercurial discovery to PhabricatorRepositoryDiscoveryEngine
ClosedPublic

Authored by epriestley on Nov 6 2013, 6:57 PM.
Tags
None
Referenced Files
F13146877: D7518.diff
Fri, May 3, 10:48 AM
F13137641: D7518.id.diff
Thu, May 2, 8:05 PM
Unknown Object (File)
Mon, Apr 29, 2:07 PM
Unknown Object (File)
Wed, Apr 24, 9:57 PM
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
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

Branch
importing3
Lint
Lint Passed
Unit
Tests Passed

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