##// END OF EJS Templates
dirstate: don't walk ignored directories...
Alexis S. L. Carvalho -
r6032:b41f0d6a default
parent child Browse files
Show More
@@ -369,6 +369,14 b' class dirstate(object):'
369 369 % (self.pathto(f), kind))
370 370 return False
371 371
372 def _dirignore(self, f):
373 if self._ignore(f):
374 return True
375 for c in strutil.findall(f, '/'):
376 if self._ignore(f[:c]):
377 return True
378 return False
379
372 380 def walk(self, files=None, match=util.always, badmatch=None):
373 381 # filter out the stat
374 382 for src, f, st in self.statwalk(files, match, badmatch=badmatch):
@@ -404,9 +412,11 b' class dirstate(object):'
404 412 return match(file_)
405 413
406 414 ignore = self._ignore
415 dirignore = self._dirignore
407 416 if ignored:
408 417 imatch = match
409 418 ignore = util.never
419 dirignore = util.never
410 420
411 421 # self._root may end with a path separator when self._root == '/'
412 422 common_prefix_len = len(self._root)
@@ -492,8 +502,9 b' class dirstate(object):'
492 502 yield 'b', ff, None
493 503 continue
494 504 if s_isdir(st.st_mode):
495 for f, src, st in findfiles(f):
496 yield src, f, st
505 if not dirignore(nf):
506 for f, src, st in findfiles(f):
507 yield src, f, st
497 508 else:
498 509 if nf in known:
499 510 continue
@@ -92,6 +92,13 b' hg rm fenugreek'
92 92 debugwalk fenugreek
93 93 touch new
94 94 debugwalk new
95
96 mkdir ignored
97 touch ignored/file
98 echo '^ignored$' > .hgignore
99 debugwalk ignored
100 debugwalk ignored/file
101
95 102 chdir ..
96 103 debugwalk -R t t/mammals/skunk
97 104 mkdir t2
@@ -278,6 +278,11 b' m fenugreek fenugreek exact'
278 278 hg debugwalk new
279 279 f new new exact
280 280
281 hg debugwalk ignored
282
283 hg debugwalk ignored/file
284 f ignored/file ignored/file exact
285
281 286 cd ..
282 287
283 288 hg debugwalk -R t t/mammals/skunk
General Comments 0
You need to be logged in to leave comments. Login now