workingcopy: handle file normalization for rust walker

Summary:
On case insensitive systems we need to normalize file case. I've made a
rust case normalizer, but it requires some more tweaks. In the mean time, let's
handle this at the matching and output stages of the rust walk.

This is probably the pattern we want to follow later anyway, so the walk is
completely decoupled from normalization.

Reviewed By: kulshrax

Differential Revision: D19543797

fbshipit-source-id: 2ef8bdcecb2611a08680441fc030c64c2f4097d1
This commit is contained in:
Durham Goode 2020-03-16 10:11:19 -07:00 committed by Facebook GitHub Bot
parent 27d1ebe9ba
commit 01285a9d4a

View File

@ -252,10 +252,24 @@ class physicalfilesystem(object):
# 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)
origmatch = matchmod.differencematcher(match, self.dirstate._ignore)
normalize = self.dirstate.normalize
class normalizematcher(object):
def visitdir(self, path):
return origmatch.visitdir(normalize(path))
def __call__(self, path):
return origmatch(normalize(path))
def bad(self, path, msg):
return origmatch.bad(path, msg)
match = normalizematcher()
walker = workingcopy.walker(join(""), match)
for fn in walker:
fn = self.dirstate.normalize(fn)
st = util.lstat(join(fn))
yield fn, st