comparison mercurial/posix.py @ 10218:750b7a4f01f6 stable

Add support for relinking on Windows. Test and minor code change by Patrick M?zard <pmezard@gmail.com>
author Siddharth Agarwal <sid.bugzilla@gmail.com>
date Fri, 08 Jan 2010 18:48:39 +0530
parents 8b8920209317
children 2f7a38f336f4 25e572394f5c
comparison
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.