changeset 13038:670f4e98276d stable

checknlink: return False if .hgtmp file preexists (issue2517) If os_link fails on Windows, errno is always errno.EINVAL, so we can't really say if the testlink could not be created because (a) the FS doesn't support hardlinks or (b) there is a leaked .hgtmp file lying around from a previous crashed run. So let's err on the safe side, keep the code simple and assume we can't detect hardlinks in both cases.
author Adrian Buehlmann <adrian@cadifra.com>
date Tue, 23 Nov 2010 22:53:47 +0100
parents f08df4d38442
children dd24f3e7ca9e
files mercurial/util.py
diffstat 1 files changed, 1 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/util.py	Tue Nov 16 13:06:07 2010 -0600
+++ b/mercurial/util.py	Tue Nov 23 22:53:47 2010 +0100
@@ -722,10 +722,7 @@
 
     try:
         os_link(testfile, f)
-    except OSError, inst:
-        if inst.errno == errno.EINVAL:
-            # FS doesn't support creating hardlinks
-            return True
+    except OSError:
         return False
 
     try: