diff mercurial/win32.py @ 13976:9ca1ff3d4f8c

win32: Wine doesn't know about hardlinks
author Matt Mackall <mpm@selenic.com>
date Thu, 21 Apr 2011 15:08:48 -0500
parents 43b5fe18ea6c
children d51630301241
line wrap: on
line diff
--- 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):