sparse: vendor Facebook-developed extension
Facebook has developed an extension to enable "sparse" checkouts -
a working directory with a subset of files. This feature is a critical
component in enabling repositories to scale to infinite number of
files while retaining reasonable performance. It's worth noting
that sparse checkout is only one possible solution to this problem:
another is virtual filesystems that realize files on first access.
But given that virtual filesystems may not be accessible to all
users, sparse checkout is necessary as a fallback.
Per mailing list discussion at
we want to add sparse checkout to the Mercurial distribution via
roughly the following mechanism:
- Vendor extension as-is with minimal modifications (this patch)
- Refactor extension so it is more clearly experimental and inline with Mercurial practices
- Move code from extension into core where possible
- Drop experimental labeling and/or move feature into core after sign-off from narrow clone feature owners
A list of modifications made as part of vendoring is as follows:
- "EXPERIMENTAL" added to module docstring
- Imports were changed to match Mercurial style conventions
- "testedwith" value was updated to core Mercurial special value and comment boilerplate was inserted
- A "clone_sparse" function was renamed to "clonesparse" to appease the style checker
- Paths to the sparse extension in tests reflect built-in location
- test-sparse-extensions.t was renamed to test-sparse-fsmonitor.t and references to "simplecache" were removed. The test always skips because it isn't trivial to run it given the way we currently run fsmonitor tests
- A double empty line was removed from test-sparse-profiles.t
There are aspects of the added code that are obviously not ideal.
The goal is to make a minimal number of modifications as part of
the vendoring to make it easier to track changes from the original
implementation. Refactoring will occur in subsequent patches.