mercurial/util.py
branchstable
changeset 24902 986a5c23b1c1
parent 24692 144883a8d0d4
child 25088 754df8e932d3
equal deleted inserted replaced
24894:c48850339988 24902:986a5c23b1c1
   875     Return true if the given path is on a case-sensitive filesystem
   875     Return true if the given path is on a case-sensitive filesystem
   876 
   876 
   877     Requires a path (like /foo/.hg) ending with a foldable final
   877     Requires a path (like /foo/.hg) ending with a foldable final
   878     directory component.
   878     directory component.
   879     """
   879     """
   880     s1 = os.stat(path)
   880     s1 = os.lstat(path)
   881     d, b = os.path.split(path)
   881     d, b = os.path.split(path)
   882     b2 = b.upper()
   882     b2 = b.upper()
   883     if b == b2:
   883     if b == b2:
   884         b2 = b.lower()
   884         b2 = b.lower()
   885         if b == b2:
   885         if b == b2:
   886             return True # no evidence against case sensitivity
   886             return True # no evidence against case sensitivity
   887     p2 = os.path.join(d, b2)
   887     p2 = os.path.join(d, b2)
   888     try:
   888     try:
   889         s2 = os.stat(p2)
   889         s2 = os.lstat(p2)
   890         if s2 == s1:
   890         if s2 == s1:
   891             return False
   891             return False
   892         return True
   892         return True
   893     except OSError:
   893     except OSError:
   894         return True
   894         return True