mercurial/posix.py
branchstable
changeset 10218 750b7a4f01f6
parent 9549 8b8920209317
child 10237 2f7a38f336f4
child 10263 25e572394f5c
equal deleted inserted replaced
10217:2bbb4c8eb27e 10218:750b7a4f01f6
   103     return path
   103     return path
   104 
   104 
   105 def localpath(path):
   105 def localpath(path):
   106     return path
   106     return path
   107 
   107 
       
   108 def samefile(fpath1, fpath2):
       
   109     """Returns whether path1 and path2 refer to the same file. This is only
       
   110     guaranteed to work for files, not directories."""
       
   111     return os.path.samefile(fpath1, fpath2)
       
   112 
       
   113 def samedevice(fpath1, fpath2):
       
   114     """Returns whether fpath1 and fpath2 are on the same device. This is only
       
   115     guaranteed to work for files, not directories."""
       
   116     st1 = os.lstat(fpath1)
       
   117     st2 = os.lstat(fpath2)
       
   118     return st1.st_dev == st2.st_dev
       
   119 
   108 if sys.platform == 'darwin':
   120 if sys.platform == 'darwin':
   109     def realpath(path):
   121     def realpath(path):
   110         '''
   122         '''
   111         Returns the true, canonical file system path equivalent to the given
   123         Returns the true, canonical file system path equivalent to the given
   112         path.
   124         path.