This is an archive of the discontinued Mercurial Phabricator instance.

narrow: filter files by narrowspec in ctx.matches()
ClosedPublic

Authored by martinvonz on Oct 5 2018, 6:35 PM.

Details

Summary

This has no effect yet because 1) for committed changes, ctx.matches()
just calls ctx.walk(), which we updated in the previous patch, and 2)
for the working copy, the filtering is also done in the overridden
dirstate.walk() in narrowdirstate.

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.Oct 5 2018, 6:35 PM
This revision was automatically updated to reflect the committed changes.

This has no effect yet [...] for the working copy, the filtering is also done in the overridden dirstate.walk() in narrowdirstate.

For the record, that turned out to be a (small) lie: dirstate.matches() doesn't call dirstate.walk(), so the override of dirstate.walk() had no effect here. A consequence is that we'll now filter out paths in the dirstate that are outside the narrowspec. That doesn't normally happen, but it can happen e.g. with hg share (that's how I noticed). I think the change is for the better, but I thought I should let you know that the commit message was incorrect.