win32: Wine doesn't know about hardlinks
authorMatt Mackall <mpm@selenic.com>
Thu, 21 Apr 2011 15:08:48 -0500
changeset 13976 9ca1ff3d4f8c
parent 13975 938fbeacac84
child 13982 4441967826ca
win32: Wine doesn't know about hardlinks
mercurial/win32.py
--- a/mercurial/win32.py	Thu Apr 21 16:06:19 2011 +0200
+++ b/mercurial/win32.py	Thu Apr 21 15:08:48 2011 -0500
@@ -141,7 +141,10 @@
         _kernel32.CloseHandle(fh)
 
 def os_link(src, dst):
-    if not _kernel32.CreateHardLinkA(dst, src, None):
+    try:
+        if not _kernel32.CreateHardLinkA(dst, src, None):
+            _raiseoserror(src)
+    except AttributeError: # Wine doesn't support this function
         _raiseoserror(src)
 
 def nlinks(name):