##// END OF EJS Templates
dirstate.walk: change names for dc and known...
Matt Mackall -
r6821:d8367107 default
parent child Browse files
Show More
@@ -444,10 +444,10 b' class dirstate(object):'
444 files = util.unique(match.files())
444 files = util.unique(match.files())
445 if not files or '.' in files:
445 if not files or '.' in files:
446 files = ['']
446 files = ['']
447 dc = self._map
447 dmap = self._map
448
448
449 def imatch(file_):
449 def imatch(file_):
450 if file_ not in dc and self._ignore(file_):
450 if file_ not in dmap and self._ignore(file_):
451 return False
451 return False
452 return match(file_)
452 return match(file_)
453
453
@@ -479,21 +479,21 b' class dirstate(object):'
479 found = []
479 found = []
480 add = found.append
480 add = found.append
481
481
482 known = {'.hg': 1}
482 seen = {'.hg': 1}
483
483
484 # step one, find all files that match our criteria
484 # step one, find all files that match our criteria
485 for ff in util.sort(files):
485 for ff in util.sort(files):
486 nf = normpath(ff)
486 nf = normpath(ff)
487 nn = self.normalize(nf)
487 nn = self.normalize(nf)
488 f = _join(ff)
488 f = _join(ff)
489 if nn in known:
489 if nn in seen:
490 continue
490 continue
491
491
492 try:
492 try:
493 st = lstat(f)
493 st = lstat(f)
494 except OSError, inst:
494 except OSError, inst:
495 keep = False
495 keep = False
496 for fn in dc:
496 for fn in dmap:
497 if nf == fn or (fn.startswith(nf) and fn[len(nf)] == '/'):
497 if nf == fn or (fn.startswith(nf) and fn[len(nf)] == '/'):
498 keep = True
498 keep = True
499 break
499 break
@@ -505,10 +505,10 b' class dirstate(object):'
505 continue
505 continue
506
506
507 if not s_isdir(st.st_mode):
507 if not s_isdir(st.st_mode):
508 known[nn] = 1
508 seen[nn] = 1
509 if supported(ff, st.st_mode, verbose=True):
509 if supported(ff, st.st_mode, verbose=True):
510 yield self.normalize(nf), st
510 yield self.normalize(nf), st
511 elif ff in dc:
511 elif ff in dmap:
512 yield nf, None
512 yield nf, None
513 continue
513 continue
514
514
@@ -537,9 +537,9 b' class dirstate(object):'
537 for f, kind, st in entries:
537 for f, kind, st in entries:
538 np = pconvert(join(nd, f))
538 np = pconvert(join(nd, f))
539 nn = self.normalize(np)
539 nn = self.normalize(np)
540 if np in known:
540 if np in seen:
541 continue
541 continue
542 known[nn] = 1
542 seen[nn] = 1
543 p = join(top, f)
543 p = join(top, f)
544 # don't trip over symlinks
544 # don't trip over symlinks
545 if kind == stat.S_IFDIR:
545 if kind == stat.S_IFDIR:
@@ -547,22 +547,22 b' class dirstate(object):'
547 wadd(p)
547 wadd(p)
548 if hasattr(match, 'dir'):
548 if hasattr(match, 'dir'):
549 match.dir(np)
549 match.dir(np)
550 if np in dc and match(np):
550 if np in dmap and match(np):
551 add((nn, None))
551 add((nn, None))
552 elif imatch(np):
552 elif imatch(np):
553 if supported(np, st.st_mode):
553 if supported(np, st.st_mode):
554 add((nn, st))
554 add((nn, st))
555 elif np in dc:
555 elif np in dmap:
556 add((nn, None))
556 add((nn, None))
557 for e in util.sort(found):
557 for e in util.sort(found):
558 yield e
558 yield e
559
559
560 # step two run through anything left in the dc hash and yield
560 # step two run through anything left in the dmap hash and yield
561 # if we haven't already seen it
561 # if we haven't already seen it
562 for f in util.sort(dc):
562 for f in util.sort(dmap):
563 if f in known or not match(f):
563 if f in seen or not match(f):
564 continue
564 continue
565 known[f] = 1
565 seen[f] = 1
566 try:
566 try:
567 st = lstat(_join(f))
567 st = lstat(_join(f))
568 if supported(f, st.st_mode):
568 if supported(f, st.st_mode):
General Comments 0
You need to be logged in to leave comments. Login now