##// END OF EJS Templates
icasefs: avoid path-absoluteness/existance check in util.fspath() for efficiency...
FUJIWARA Katsunori -
r15710:f63e4004 default
parent child Browse files
Show More
@@ -614,22 +614,13 b' def checkcase(path):'
614 def fspath(name, root):
614 def fspath(name, root):
615 '''Get name in the case stored in the filesystem
615 '''Get name in the case stored in the filesystem
616
616
617 The name is either relative to root, or it is an absolute path starting
617 The name should be relative to root, and be normcase-ed for efficiency.
618 with root. Note that this function is unnecessary, and should not be
618
619 Note that this function is unnecessary, and should not be
619 called, for case-sensitive filesystems (simply because it's expensive).
620 called, for case-sensitive filesystems (simply because it's expensive).
620
621
621 Both name and root should be normcase-ed.
622 The root should be normcase-ed, too.
622 '''
623 '''
623 # If name is absolute, make it relative
624 if name.startswith(root):
625 l = len(root)
626 if name[l] == os.sep or name[l] == os.altsep:
627 l = l + 1
628 name = name[l:]
629
630 if not os.path.lexists(os.path.join(root, name)):
631 return None
632
633 def find(p, contents):
624 def find(p, contents):
634 lenp = len(p)
625 lenp = len(p)
635 for n in contents:
626 for n in contents:
General Comments 0
You need to be logged in to leave comments. Login now