util.copyfiles: only switch to copy if hardlink raises IOError or OSError.
authorVadim Gelfer <vadim.gelfer@gmail.com>
Wed, 05 Apr 2006 17:17:07 -0700
changeset 2050 e49d0fa38176
parent 2049 f70952384ae7
child 2051 6a03cff2b0f5
util.copyfiles: only switch to copy if hardlink raises IOError or OSError. before this, interrupting clone would give "file a same as file b" error because caught KeyboardInterrupt.
mercurial/util.py
--- a/mercurial/util.py	Wed Apr 05 19:07:50 2006 +0200
+++ b/mercurial/util.py	Wed Apr 05 17:17:07 2006 -0700
@@ -393,7 +393,7 @@
         if hardlink:
             try:
                 os_link(src, dst)
-            except:
+            except (IOError, OSError):
                 hardlink = False
                 shutil.copy(src, dst)
         else: