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.
--- 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: