comparison mercurial/util.py @ 15719:1dd60426b061

icasefs: follow standard cache look up pattern
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Sat, 24 Dec 2011 00:51:14 +0900
parents c604a3d1969d
children 3bcfea777efc
comparison
equal deleted inserted replaced
15718:c604a3d1969d 15719:1dd60426b061
638 for part, sep in pattern.findall(name): 638 for part, sep in pattern.findall(name):
639 if sep: 639 if sep:
640 result.append(sep) 640 result.append(sep)
641 continue 641 continue
642 642
643 contents = _fspathcache.get(dir, None) 643 if dir not in _fspathcache:
644 if contents is None: 644 _fspathcache[dir] = os.listdir(dir)
645 contents = os.listdir(dir) 645 contents = _fspathcache[dir]
646 _fspathcache[dir] = contents
647 646
648 found = find(part, contents) 647 found = find(part, contents)
649 if not found: 648 if not found:
650 # retry once for the corner case: add files after dir walking 649 # retry once for the corner case: add files after dir walking
651 contents = os.listdir(dir) 650 contents = os.listdir(dir)