This is an archive of the discontinued Mercurial Phabricator instance.

exchangev2: recognize narrow patterns when pulling
ClosedPublic

Authored by indygreg on Oct 17 2018, 9:17 AM.

Details

Summary

pulloperation instances were recently taught to record file
include and exclude patterns to facilitate narrow file transfer.
Teaching the exchangev2 code to transfer a subset of files is
as simple as constructing a narrow matcher from these patterns and
filtering all seen file paths through it.

Keep in mind that this change only influences file data: we're
still fetching all changeset and manifest data. So, there's still
a ton of "partial clone" to implement in exchangev2.

On a personal note, I derive gratification that this feature requires
very few lines of new code to implement.

To test this, we implemented a minimal extension which allows us to specify
--include/--exclude to clone. While the narrow extension provides these
arguments, I explicitly wanted to test this functionality without the
narrow extension enabled, as that extension monkeypatches various things
and I want to isolate the behavior of core Mercurial.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

indygreg created this revision.Oct 17 2018, 9:17 AM
durin42 accepted this revision.Oct 17 2018, 9:28 AM
durin42 added a subscriber: durin42.
durin42 added inline comments.
tests/pullext.py
2

"test narrow pulling" maybe? I feel like that's mostly what it is...

This revision is now accepted and ready to land.Oct 17 2018, 9:28 AM
This revision was automatically updated to reflect the committed changes.