Implement --no-traverse flag to stop copy traversing the destination remote.

Refactor sync/copy/move
  * Don't load the src listing unless doing a sync and --delete-before
  * Don't load the dst listing if doing copy/move and --no-traverse is set

`rclone --no-traverse copy src dst` now won't load either of the
listings into memory so will use the minimum amount of memory.

This change will reduce the amount of memory rclone uses dramatically
too as in normal operations (copy without --notraverse or sync) as it
no longer loads the source file listing into memory at all.

Fixes #8
Fixes #544
Fixes #546
This commit is contained in:
Nick Craig-Wood
2016-06-25 14:28:26 +01:00
parent 13797a1fb8
commit af4ef8ad8d
5 changed files with 174 additions and 109 deletions

View File

@@ -44,6 +44,7 @@ var (
ErrorListAborted = errors.New("list aborted")
ErrorListOnlyRoot = errors.New("can only list from root")
ErrorIsFile = errors.New("is a file not a directory")
ErrorNotDeleting = errors.New("not deleting files as there were IO errors")
)
// RegInfo provides information about a filesystem