mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 16:57:49 +03:00
workingcopy: support ignore files from rust walker
Summary: Previously it didn't handle ignoring ignored files. Let's support this via simple matcher composition. Reviewed By: kulshrax Differential Revision: D19543792 fbshipit-source-id: 0c807f3c1ffc10894f13373cbe9deb2b824f1ac9
This commit is contained in:
parent
05e09b2b89
commit
27d1ebe9ba
@ -16,7 +16,7 @@ import stat
|
||||
from typing import Callable, Iterable, Optional, Tuple
|
||||
|
||||
from bindings import workingcopy
|
||||
from edenscm.mercurial import registrar
|
||||
from edenscm.mercurial import match as matchmod, registrar
|
||||
|
||||
from . import encoding, error, pathutil, util, vfs as vfsmod
|
||||
from .i18n import _
|
||||
@ -247,6 +247,13 @@ class physicalfilesystem(object):
|
||||
@util.timefunction("fswalk", 0, "ui")
|
||||
def _rustwalk(self, match, listignored=False):
|
||||
join = self.opener.join
|
||||
if not listignored:
|
||||
# Have the matcher skip ignored files. Technically exact files
|
||||
# provided by the user should be returned even if they're ignored.
|
||||
# The differencematcher handles this and returns True for exact
|
||||
# matches, even if they should be subtracted.
|
||||
match = matchmod.differencematcher(match, self.dirstate._ignore)
|
||||
|
||||
walker = workingcopy.walker(join(""), match)
|
||||
for fn in walker:
|
||||
st = util.lstat(join(fn))
|
||||
|
Loading…
Reference in New Issue
Block a user