equal
deleted
inserted
replaced
612 except OSError: |
612 except OSError: |
613 pass |
613 pass |
614 |
614 |
615 def copyfile(src, dest): |
615 def copyfile(src, dest): |
616 "copy a file, preserving mode" |
616 "copy a file, preserving mode" |
617 try: |
617 if os.path.islink(src): |
618 shutil.copyfile(src, dest) |
618 try: |
619 shutil.copymode(src, dest) |
619 os.unlink(dest) |
620 except shutil.Error, inst: |
620 except: |
621 raise Abort(str(inst)) |
621 pass |
|
622 os.symlink(os.readlink(src), dest) |
|
623 else: |
|
624 try: |
|
625 shutil.copyfile(src, dest) |
|
626 shutil.copymode(src, dest) |
|
627 except shutil.Error, inst: |
|
628 raise Abort(str(inst)) |
622 |
629 |
623 def copyfiles(src, dst, hardlink=None): |
630 def copyfiles(src, dst, hardlink=None): |
624 """Copy a directory tree using hardlinks if possible""" |
631 """Copy a directory tree using hardlinks if possible""" |
625 |
632 |
626 if hardlink is None: |
633 if hardlink is None: |