This is an archive of the discontinued Mercurial Phabricator instance.

narrow: move narrowmatch-related methods to localrepo
ClosedPublic

Authored by martinvonz on Feb 28 2018, 3:56 PM.

Details

Summary

This patch makes it so localrepo.narrowmatch() and a few more are
always available, which will let us simplify the use sites a
bit. narrowmatch() will return an always-matcher in non-narrow repos
(just like it did when it lived in the narrow extension).

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

martinvonz created this revision.Feb 28 2018, 3:56 PM
indygreg accepted this revision.Feb 28 2018, 9:13 PM
indygreg added a subscriber: indygreg.

I know we're trying to remove methods from localrepository so it is smaller. narrowpats and _narrowmatch need to be there because of @repofilecache. And narrowmatch is the thing we want to add to localrepository. I suppose setnarrowpats could live outside the class. But we don't have a better place in core yet. So I'm going to call it scope bloat and something that can be deferred to a follow-up patch, if desired.

This revision is now accepted and ready to land.Feb 28 2018, 9:13 PM
This revision was automatically updated to reflect the committed changes.