equal
deleted
inserted
replaced
631 except KeyError: |
631 except KeyError: |
632 return str(gid) |
632 return str(gid) |
633 except ImportError: |
633 except ImportError: |
634 return None |
634 return None |
635 |
635 |
|
636 # File system features |
|
637 |
|
638 def checkfolding(path): |
|
639 """ |
|
640 Check whether the given path is on a case-sensitive filesystem |
|
641 |
|
642 Requires a path (like /foo/.hg) ending with a foldable final |
|
643 directory component. |
|
644 """ |
|
645 s1 = os.stat(path) |
|
646 d, b = os.path.split(path) |
|
647 p2 = os.path.join(d, b.upper()) |
|
648 if path == p2: |
|
649 p2 = os.path.join(d, b.lower()) |
|
650 try: |
|
651 s2 = os.stat(p2) |
|
652 if s2 == s1: |
|
653 return False |
|
654 return True |
|
655 except: |
|
656 return True |
|
657 |
636 # Platform specific variants |
658 # Platform specific variants |
637 if os.name == 'nt': |
659 if os.name == 'nt': |
638 demandload(globals(), "msvcrt") |
660 demandload(globals(), "msvcrt") |
639 nulldev = 'NUL:' |
661 nulldev = 'NUL:' |
640 |
662 |