# HG changeset patch # User Adrian Buehlmann # Date 1290549227 -3600 # Node ID 670f4e98276ddc6a9e43d60e3e4bfe8f49246a67 # Parent f08df4d38442bf641859f3de860ce0e5b6ba7763 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. diff -r f08df4d38442 -r 670f4e98276d mercurial/util.py --- 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: