##// END OF EJS Templates
dirstate.walk: inline imatch...
Matt Mackall -
r6832:643ff338 default
parent child Browse files
Show More
@@ -434,14 +434,10 b' class dirstate(object):'
434 self._ui.warn(_('%s: unsupported file type (type is %s)\n')
434 self._ui.warn(_('%s: unsupported file type (type is %s)\n')
435 % (self.pathto(f), kind))
435 % (self.pathto(f), kind))
436
436
437 def imatch(f):
438 return (f in dmap or not ignore(f)) and match(f)
439
440 # TODO: don't walk unknown directories if unknown and ignored are False
437 # TODO: don't walk unknown directories if unknown and ignored are False
441 ignore = self._ignore
438 ignore = self._ignore
442 dirignore = self._dirignore
439 dirignore = self._dirignore
443 if ignored:
440 if ignored:
444 imatch = match
445 ignore = util.never
441 ignore = util.never
446 dirignore = util.never
442 dirignore = util.never
447
443
@@ -493,8 +489,9 b' class dirstate(object):'
493 if not keep:
489 if not keep:
494 if inst.errno != errno.ENOENT:
490 if inst.errno != errno.ENOENT:
495 fwarn(ff, inst.strerror)
491 fwarn(ff, inst.strerror)
496 elif badfn(ff, inst.strerror) and imatch(nf):
492 elif badfn(ff, inst.strerror):
497 results[nf] = None
493 if (nf in dmap or not ignore(nf)) and match(nf):
494 results[nf] = None
498
495
499 # step 2: visit subdirectories
496 # step 2: visit subdirectories
500 while work:
497 while work:
@@ -520,11 +517,14 b' class dirstate(object):'
520 wadd(nf)
517 wadd(nf)
521 if nf in dmap and match(nf):
518 if nf in dmap and match(nf):
522 results[nf] = None
519 results[nf] = None
523 elif imatch(nf):
520 elif kind == regkind or kind == lnkkind:
524 if kind == regkind or kind == lnkkind:
521 if nf in dmap:
522 if match(nf):
523 results[nf] = st
524 elif match(nf) and not ignore(nf):
525 results[nf] = st
525 results[nf] = st
526 elif nf in dmap:
526 elif nf in dmap and match(nf):
527 results[nf] = None
527 results[nf] = None
528
528
529 # step 3: report unseen items in the dmap hash
529 # step 3: report unseen items in the dmap hash
530 for nf in util.sort(dmap):
530 for nf in util.sort(dmap):
General Comments 0
You need to be logged in to leave comments. Login now