changeset 2193:fb28ce04b349

add util.samestat function for windows. windows does not have os.path.samestat, and stat().st_ino is always zero, so util.samestat always returns false on windows.
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Wed, 03 May 2006 22:47:08 -0700
parents 00205fe76993
children ee90e5a9197f
files mercurial/util.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -231,7 +231,7 @@ def canonpath(root, cwd, myname):
                 name_st = os.stat(name)
             except OSError:
                 break
-            if os.path.samestat(name_st, root_st):
+            if samestat(name_st, root_st):
                 rel.reverse()
                 name = os.path.join(*rel)
                 audit_path(name)
@@ -561,6 +561,9 @@ if os.name == 'nt':
     makelock = _makelock_file
     readlock = _readlock_file
 
+    def samestat(s1, s2):
+        return False
+
     def explain_exit(code):
         return _("exited with status %d") % code, code
 
@@ -627,6 +630,7 @@ else:
         return path
 
     normpath = os.path.normpath
+    samestat = os.path.samestat
 
     def makelock(info, pathname):
         try: