Mercurial > public > mercurial-scm > hg
comparison mercurial/cmdutil.py @ 40087:1d09ba0d2ed3
narrow: move remaining narrow-limited dirstate walks to core
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.
Differential Revision: https://phab.mercurial-scm.org/D4901
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Mon, 01 Oct 2018 14:31:15 -0700 |
parents | e2697acd9381 |
children | 57500950f40e |
comparison
equal
deleted
inserted
replaced
40086:41fcdfe3bfeb | 40087:1d09ba0d2ed3 |
---|---|
2042 cca = None | 2042 cca = None |
2043 abort, warn = scmutil.checkportabilityalert(ui) | 2043 abort, warn = scmutil.checkportabilityalert(ui) |
2044 if abort or warn: | 2044 if abort or warn: |
2045 cca = scmutil.casecollisionauditor(ui, abort, repo.dirstate) | 2045 cca = scmutil.casecollisionauditor(ui, abort, repo.dirstate) |
2046 | 2046 |
2047 match = repo.narrowmatch(match, includeexact=True) | |
2047 badmatch = matchmod.badmatch(match, badfn) | 2048 badmatch = matchmod.badmatch(match, badfn) |
2048 dirstate = repo.dirstate | 2049 dirstate = repo.dirstate |
2049 # We don't want to just call wctx.walk here, since it would return a lot of | 2050 # We don't want to just call wctx.walk here, since it would return a lot of |
2050 # clean files, which we aren't interested in and takes time. | 2051 # clean files, which we aren't interested in and takes time. |
2051 for f in sorted(dirstate.walk(badmatch, subrepos=sorted(wctx.substate), | 2052 for f in sorted(dirstate.walk(badmatch, subrepos=sorted(wctx.substate), |