equal
deleted
inserted
replaced
458 try: |
458 try: |
459 os.removedirs(os.path.dirname(f)) |
459 os.removedirs(os.path.dirname(f)) |
460 except OSError: |
460 except OSError: |
461 pass |
461 pass |
462 |
462 |
|
463 def copyfile(src, dest): |
|
464 "copy a file, preserving mode" |
|
465 try: |
|
466 shutil.copyfile(src, dest) |
|
467 shutil.copymode(src, dest) |
|
468 except shutil.Error, inst: |
|
469 raise util.Abort(str(inst)) |
|
470 |
463 def copyfiles(src, dst, hardlink=None): |
471 def copyfiles(src, dst, hardlink=None): |
464 """Copy a directory tree using hardlinks if possible""" |
472 """Copy a directory tree using hardlinks if possible""" |
465 |
473 |
466 if hardlink is None: |
474 if hardlink is None: |
467 hardlink = (os.stat(src).st_dev == |
475 hardlink = (os.stat(src).st_dev == |