Show More
@@ -81,7 +81,6 b' from mercurial import (' | |||||
81 | error, |
|
81 | error, | |
82 | extensions, |
|
82 | extensions, | |
83 | logcmdutil, |
|
83 | logcmdutil, | |
84 | match as matchmod, |
|
|||
85 | merge as mergemod, |
|
84 | merge as mergemod, | |
86 | pycompat, |
|
85 | pycompat, | |
87 | registrar, |
|
86 | registrar, | |
@@ -213,18 +212,6 b' def _setupdirstate(ui):' | |||||
213 | and to prevent modifications to files outside the checkout. |
|
212 | and to prevent modifications to files outside the checkout. | |
214 | """ |
|
213 | """ | |
215 |
|
214 | |||
216 | def walk(orig, self, match, subrepos, unknown, ignored, full=True): |
|
|||
217 | # hack to not exclude explicitly-specified paths so that they can |
|
|||
218 | # be warned later on e.g. dirstate.add() |
|
|||
219 | sparse_matcher = self._sparsematcher |
|
|||
220 | if sparse_matcher is not None: |
|
|||
221 | em = matchmod.exact(match.files()) |
|
|||
222 | sm = matchmod.unionmatcher([self._sparsematcher, em]) |
|
|||
223 | match = matchmod.intersectmatchers(match, sm) |
|
|||
224 | return orig(self, match, subrepos, unknown, ignored, full) |
|
|||
225 |
|
||||
226 | extensions.wrapfunction(dirstate.dirstate, b'walk', walk) |
|
|||
227 |
|
||||
228 | # dirstate.rebuild should not add non-matching files |
|
215 | # dirstate.rebuild should not add non-matching files | |
229 | def _rebuild(orig, self, parent, allfiles, changedfiles=None): |
|
216 | def _rebuild(orig, self, parent, allfiles, changedfiles=None): | |
230 | matcher = self._sparsematcher |
|
217 | matcher = self._sparsematcher |
@@ -984,6 +984,11 b' class dirstate:' | |||||
984 | ignore = util.always |
|
984 | ignore = util.always | |
985 | dirignore = util.always |
|
985 | dirignore = util.always | |
986 |
|
986 | |||
|
987 | if self._sparsematchfn is not None: | |||
|
988 | em = matchmod.exact(match.files()) | |||
|
989 | sm = matchmod.unionmatcher([self._sparsematcher, em]) | |||
|
990 | match = matchmod.intersectmatchers(match, sm) | |||
|
991 | ||||
987 | matchfn = match.matchfn |
|
992 | matchfn = match.matchfn | |
988 | matchalways = match.always() |
|
993 | matchalways = match.always() | |
989 | matchtdir = match.traversedir |
|
994 | matchtdir = match.traversedir |
General Comments 0
You need to be logged in to leave comments.
Login now