"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
dedupe: add quit as a choice in interactive mode
albertony237daa8aaf73
diff --git a/docs/content/commands/rclone_dedupe.md b/docs/content/commands/rclone_dedupe.mdindex 2cb5de2e9..fd0679086 100644--- a/docs/content/commands/rclone_dedupe.md+++ b/docs/content/commands/rclone_dedupe.md@@ -74,7 +74,8 @@ Now the `dedupe` sessions) Skip and do nothingk) Keep just one (choose which in next step)r) Rename all to be different (by changing file.jpg to file-1.jpg)- s/k/r> k+ q) Quit+ s/k/r/q> kEnter the number of the file to keep> 1one.txt: Deleted 1 extra copiestwo.txt: Found 3 files with duplicate names@@ -85,7 +86,8 @@ Now the `dedupe` sessions) Skip and do nothingk) Keep just one (choose which in next step)r) Rename all to be different (by changing file.jpg to file-1.jpg)- s/k/r> r+ q) Quit+ s/k/r/q> rtwo-1.txt: renamed from: two.txttwo-2.txt: renamed from: two.txttwo-3.txt: renamed from: two.txtdiff --git a/fs/operations/dedupe.go b/fs/operations/dedupe.goindex 1da760a7a..32daa9d4d 100644--- a/fs/operations/dedupe.go+++ b/fs/operations/dedupe.go@@ -158,12 +158,13 @@ func dedupeList(ctx context.Context, f fs.Fs, ht hash.Type, remote string, objs}// dedupeInteractive interactively dedupes the slice of objects-func dedupeInteractive(ctx context.Context, f fs.Fs, ht hash.Type, remote string, objs []fs.Object, byHash bool) {+func dedupeInteractive(ctx context.Context, f fs.Fs, ht hash.Type, remote string, objs []fs.Object, byHash bool) bool {dedupeList(ctx, f, ht, remote, objs, byHash)commands := []string{"sSkip and do nothing", "kKeep just one (choose which in next step)"}if !byHash {commands = append(commands, "rRename all to be different (by changing file.jpg to file-1.jpg)")}+ commands = append(commands, "qQuit")switch config.Command(commands) {case 's':case 'k':@@ -171,7 +172,10 @@ func dedupeInteractive(ctx context.Context, f fs.Fs, ht hash.Type, remote stringdedupeDeleteAllButOne(ctx, keep-1, remote, objs)case 'r':dedupeRename(ctx, f, remote, objs)+ case 'q':+ return false}+ return true}// DeduplicateMode is how the dedupe command chooses what to do@@ -465,7 +469,9 @@ func Deduplicate(ctx context.Context, f fs.Fs, mode DeduplicateMode, byHash bool}switch mode {case DeduplicateInteractive:- dedupeInteractive(ctx, f, ht, remote, objs, byHash)+ if !dedupeInteractive(ctx, f, ht, remote, objs, byHash) {+ return nil+ }case DeduplicateFirst:dedupeDeleteAllButOne(ctx, 0, remote, objs)case DeduplicateNewest: