216 dc = self.map.copy() |
216 dc = self.map.copy() |
217 elif not dc: |
217 elif not dc: |
218 dc = self.filterfiles(files) |
218 dc = self.filterfiles(files) |
219 |
219 |
220 def statmatch(file, stat): |
220 def statmatch(file, stat): |
|
221 file = util.pconvert(file) |
221 if file not in dc and self.ignore(file): |
222 if file not in dc and self.ignore(file): |
222 return False |
223 return False |
223 return match(file) |
224 return match(file) |
|
225 |
224 return self.walkhelper(files=files, statmatch=statmatch, dc=dc) |
226 return self.walkhelper(files=files, statmatch=statmatch, dc=dc) |
225 |
227 |
226 # walk recursively through the directory tree, finding all files |
228 # walk recursively through the directory tree, finding all files |
227 # matched by the statmatch function |
229 # matched by the statmatch function |
228 # |
230 # |
229 # results are yielded in a tuple (src, filename), where src is one of: |
231 # results are yielded in a tuple (src, filename), where src is one of: |
230 # 'f' the file was found in the directory tree |
232 # 'f' the file was found in the directory tree |
231 # 'm' the file was only in the dirstate and not in the tree |
233 # 'm' the file was only in the dirstate and not in the tree |
232 # |
234 # |
233 # dc is an optional arg for the current dirstate. dc is not modified |
235 # dc is an optional arg for the current dirstate. dc is not modified |
322 |
324 |
323 # statmatch function to eliminate entries from the dirstate copy |
325 # statmatch function to eliminate entries from the dirstate copy |
324 # and put files into the appropriate array. This gets passed |
326 # and put files into the appropriate array. This gets passed |
325 # to the walking code |
327 # to the walking code |
326 def statmatch(fn, s): |
328 def statmatch(fn, s): |
|
329 fn = util.pconvert(fn) |
327 def checkappend(l, fn): |
330 def checkappend(l, fn): |
328 if match is util.always or match(fn): |
331 if match is util.always or match(fn): |
329 l.append(fn) |
332 l.append(fn) |
330 |
333 |
331 if not s or stat.S_ISDIR(s.st_mode): |
334 if not s or stat.S_ISDIR(s.st_mode): |
332 return self.ignore(fn) and False or match(fn) |
335 return self.ignore(fn) and False or match(fn) |
333 |
336 |
334 if not stat.S_ISREG(s.st_mode): |
337 if not stat.S_ISREG(s.st_mode): |
335 return False |
338 return False |