changeset 18326 | 614f769e6aa7 |
parent 18026 | ddc0323db78b |
child 18537 | ae60735e37d2 |
--- a/mercurial/util.py Tue Jan 15 01:05:11 2013 +0100 +++ b/mercurial/util.py Thu Jan 10 00:44:23 2013 +0100 @@ -482,11 +482,9 @@ def copyfile(src, dest): "copy a file, preserving mode and atime/mtime" + if os.path.lexists(dest): + unlink(dest) if os.path.islink(src): - try: - os.unlink(dest) - except OSError: - pass os.symlink(os.readlink(src), dest) else: try: