This repository has been archived by the owner on Nov 4, 2018. It is now read-only.
forked from s3tools/s3cmd
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
handle remote->local transfers with local hardlink/copy if possible
Reworked some of the hardlink / same file detection code to be a little more general purpose. Now it can be used to detect duplicate files on either remote or local side. When transferring remote->local, if we already have a copy (same md5sum) of a file locally that we would otherwise transfer, don't transfer, but hardlink it. Should hardlink not be avaialble (e.g. on Windows), use shutil.copy2() instead. This lets us avoid the second download completely. _get_filelist_local() grew an initial list argument. This lets us avoid copying / merging / updating a bunch of different lists back into one - it starts as one list and grows. Much cleaner (and the fact these were separate cost me several hours of debugging to track down why something would get set, like the by_md5 hash, only to have it be empty shortly thereafter.
- Loading branch information
Showing
3 changed files
with
35 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters