# HG changeset patch # User Matt Mackall # Date 1303416528 18000 # Node ID 9ca1ff3d4f8c90f37bd0e0cdfe2274cd03a48bd1 # Parent 938fbeacac8482b33794488e0e0e2d08b58ff423 win32: Wine doesn't know about hardlinks diff -r 938fbeacac84 -r 9ca1ff3d4f8c 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):