Mercurial > hg > mercurial-crew-with-dirclash
comparison mercurial/dirstate.py @ 1276:25e5b1086624
Fix dirstate.changes for ignored directories.
Do a second walking pass to examine any leftover files in the dirstate
map that are in the .hgignore file but match our search criteria.
This fixes the case of entire directories never being examined due to
their presence in the .hgignore file, and should hopefully not add any
significant overhead.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Sun, 18 Sep 2005 15:03:07 -0700 |
parents | 9ab14ca22e37 |
children | 32d8068b3e36 |
comparison
equal
deleted
inserted
replaced
1275:a1a84dd489ff | 1276:25e5b1086624 |
---|---|
397 # But, we still need to iterate through the results to force the | 397 # But, we still need to iterate through the results to force the |
398 # walk to complete | 398 # walk to complete |
399 for src, fn in self.walkhelper(files, statmatch, dc): | 399 for src, fn in self.walkhelper(files, statmatch, dc): |
400 pass | 400 pass |
401 | 401 |
402 # there may be patterns in the .hgignore file that prevent us | |
403 # from examining entire directories in the dirstate map, so we | |
404 # go back and explicitly examine any matching files we've | |
405 # ignored | |
406 unexamined = [fn for fn in dc.iterkeys() | |
407 if self.ignore(fn) and match(fn)] | |
408 | |
409 for src, fn in self.walkhelper(unexamined, statmatch, dc): | |
410 pass | |
411 | |
402 # anything left in dc didn't exist in the filesystem | 412 # anything left in dc didn't exist in the filesystem |
403 for fn, c in [(fn, c) for fn, c in dc.items() if match(fn)]: | 413 for fn, c in dc.iteritems(): |
414 if not match(fn): continue | |
404 if c[0] == 'r': | 415 if c[0] == 'r': |
405 removed.append(fn) | 416 removed.append(fn) |
406 else: | 417 else: |
407 deleted.append(fn) | 418 deleted.append(fn) |
408 return (lookup, modified, added, removed + deleted, unknown) | 419 return (lookup, modified, added, removed + deleted, unknown) |