This is an archive of the discontinued Mercurial Phabricator instance.

narrow: move remaining narrow-limited dirstate walks to core
ClosedPublic

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

Details

Summary

In most places we now filter at a higher level (the context object),
but there are few places that relied on the dirstate walk to be
filtered by the narrowspec. The important cases are those used by `hg
add` and hg addremove. This patch updates them to pass in a matcher
instead of relying on the dirstate to do the filtering. The dirstate
filtering is also dropped in narrowdirstate.py.

Not always filtering in the dirstate should be useful for a future `hg
status --include-outside-narrow` option.

These places now end up doing an unrestricted dirstate walk after this
patch:

  • debugfileset
  • perfwalk
  • sparse (but restricted to sparse config)
  • largefiles

I'll let anyone who cares about these cases adapt them to work with
narrow if necessary.

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
pulkit added a subscriber: pulkit.Oct 5 2018, 6:51 PM

These places now end up doing an unrestricted dirstate walk after this
patch:
debugfileset
perfwalk
sparse (but restricted to sparse config)
largefiles
I'll let anyone who cares about these cases adapt them to work with
narrow if necessary.

There is a TODO.rst in hgext/narrow I think it's worth adding this thing there. That will help people to realize that it's a know behavior and a TODO.

martinvonz updated this revision to Diff 11726.Oct 5 2018, 6:56 PM
In D4901#73949, @pulkit wrote:

These places now end up doing an unrestricted dirstate walk after this
patch:
debugfileset
perfwalk
sparse (but restricted to sparse config)
largefiles
I'll let anyone who cares about these cases adapt them to work with
narrow if necessary.

There is a TODO.rst in hgext/narrow I think it's worth adding this thing there. That will help people to realize that it's a know behavior and a TODO.

Good point. Done. I'll send some other patches to update that TODO with things I've cleaned up earlier.

This revision was automatically updated to reflect the committed changes.