Mercurial > hg > mercurial-crew-with-dirclash
comparison mercurial/util.py @ 2050:e49d0fa38176
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.
author | Vadim Gelfer <vadim.gelfer@gmail.com> |
---|---|
date | Wed, 05 Apr 2006 17:17:07 -0700 |
parents | 24c604628867 |
children | e18beba54a7e 345107e167a0 |
comparison
equal
deleted
inserted
replaced
2049:f70952384ae7 | 2050:e49d0fa38176 |
---|---|
391 copyfiles(srcname, dstname, hardlink) | 391 copyfiles(srcname, dstname, hardlink) |
392 else: | 392 else: |
393 if hardlink: | 393 if hardlink: |
394 try: | 394 try: |
395 os_link(src, dst) | 395 os_link(src, dst) |
396 except: | 396 except (IOError, OSError): |
397 hardlink = False | 397 hardlink = False |
398 shutil.copy(src, dst) | 398 shutil.copy(src, dst) |
399 else: | 399 else: |
400 shutil.copy(src, dst) | 400 shutil.copy(src, dst) |
401 | 401 |