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:
Durham Goode 2020-03-16 10:11:19 -07:00 committed by Facebook GitHub Bot
parent 05e09b2b89
commit 27d1ebe9ba

View File

@ -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))