changeset 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 938fbeacac84
children 4441967826ca
files mercurial/win32.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
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):