"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
bisync: fix conflict winner missing from listings when Path2 wins
nielash9682abe88ebe
diff --git a/cmd/bisync/listing.go b/cmd/bisync/listing.goindex 282565ff6..c57928557 100644--- a/cmd/bisync/listing.go+++ b/cmd/bisync/listing.go@@ -617,10 +617,11 @@ func (b *bisyncRun) modifyListing(ctx context.Context, src fs.Fs, dst fs.Fs, ressrcList.put(srcNewName, new.size, new.time, new.hash, new.id, new.flags)dstList.put(srcNewName, new.size, new.time, new.hash, new.id, new.flags)}- if srcNewName != srcOldName {+ // the winner of a conflict keeps the old name and is copied to the other side+ if srcNewName != srcOldName && dstNewName != srcOldName {srcList.remove(srcOldName)}- if srcNewName != dstOldName {+ if srcNewName != dstOldName && dstNewName != dstOldName {dstList.remove(dstOldName)}}diff --git a/cmd/bisync/testdata/test_resolve/golden/_testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_resolve/golden/_testdir_path1.._testdir_path2.path1.lst-oldindex 57872a027..fb238e4ce 100644--- a/cmd/bisync/testdata/test_resolve/golden/_testdir_path1.._testdir_path2.path1.lst-old+++ b/cmd/bisync/testdata/test_resolve/golden/_testdir_path1.._testdir_path2.path1.lst-old@@ -8,3 +8,4 @@- 33 - - 2003-07-23T00:00:00.000000000+0000 "file1.txt.cloud1"- 33 - - 2001-08-26T00:00:00.000000000+0000 "file1.txt.dinosaur1"- 33 - - 2003-07-23T00:00:00.000000000+0000 "file1.txt.local1"+- 33 - - 2006-03-04T00:00:00.000000000+0000 "file2.txt"diff --git a/cmd/bisync/testdata/test_resolve/golden/_testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_resolve/golden/_testdir_path1.._testdir_path2.path2.lst-oldindex 57872a027..fb238e4ce 100644--- a/cmd/bisync/testdata/test_resolve/golden/_testdir_path1.._testdir_path2.path2.lst-old+++ b/cmd/bisync/testdata/test_resolve/golden/_testdir_path1.._testdir_path2.path2.lst-old@@ -8,3 +8,4 @@- 33 - - 2003-07-23T00:00:00.000000000+0000 "file1.txt.cloud1"- 33 - - 2001-08-26T00:00:00.000000000+0000 "file1.txt.dinosaur1"- 33 - - 2003-07-23T00:00:00.000000000+0000 "file1.txt.local1"+- 33 - - 2006-03-04T00:00:00.000000000+0000 "file2.txt"diff --git a/cmd/bisync/testdata/test_resolve/golden/test.log b/cmd/bisync/testdata/test_resolve/golden/test.logindex fb4d03c0c..8aaf9a751 100644--- a/cmd/bisync/testdata/test_resolve/golden/test.log+++ b/cmd/bisync/testdata/test_resolve/golden/test.log@@ -137,11 +137,13 @@ INFO : Bisyncing with Comparison Settings:INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"INFO : Building Path1 and Path2 listingsINFO : Path1 checking for diffs-INFO : - [36mPath1[0m [35m[32mFile is new[0m[0m - [36mfile1.txt[0m-INFO : Path1: 1 changes: [32m 1 new[0m, [33m 0 modified[0m, [31m 0 deleted[0m+INFO : - [36mPath1[0m [35m[33mFile changed: [35mtime (newer)[0m[0m[0m - [36mfile1.txt[0m+INFO : Path1: 1 changes: [32m 0 new[0m, [33m 1 modified[0m, [31m 0 deleted[0m+INFO : ([33mModified[0m: [36m 1 newer[0m, [34m 0 older[0m)INFO : Path2 checking for diffs-INFO : - [34mPath2[0m [35m[32mFile is new[0m[0m - [36mfile1.txt[0m-INFO : Path2: 1 changes: [32m 1 new[0m, [33m 0 modified[0m, [31m 0 deleted[0m+INFO : - [34mPath2[0m [35m[33mFile changed: [35mtime (newer)[0m[0m[0m - [36mfile1.txt[0m+INFO : Path2: 1 changes: [32m 0 new[0m, [33m 1 modified[0m, [31m 0 deleted[0m+INFO : ([33mModified[0m: [36m 1 newer[0m, [34m 0 older[0m)INFO : Applying changesINFO : Checking potential conflicts...ERROR : file1.txt: {hashtype} differ@@ -149,7 +151,7 @@ NOTICE: {path2String}: 1 differences foundNOTICE: {path2String}: 1 errors while checkingINFO : Finished checking the potential conflicts. 1 differences foundNOTICE: - [34mWARNING[0m [35mNew or changed in both paths[0m - [36mfile1.txt[0m-INFO : file1.txt: Winner cannot be determined as sizes are equal. Path1: 33, Path2: 33, Difference: 0+INFO : file1.txt: Winner cannot be determined as sizes are equal. Path1: 0, Path2: 0, Difference: 0INFO : file1.txt: [31mA winner could not be determined.[0mNOTICE: - [36mPath1[0m [35mRenaming Path1 copy[0m - [36m{path1/}file1.txt.apple1[0mNOTICE: - [36mPath1[0m [35m[32mQueue copy to[0m Path2[0m - [36m{path2/}file1.txt.apple1[0m@@ -329,20 +331,17 @@ INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"INFO : Building Path1 and Path2 listingsINFO : Path1 checking for diffsINFO : - [36mPath1[0m [35m[33mFile changed: [35mtime (older)[0m[0m[0m - [36mfile1.txt[0m-INFO : - [36mPath1[0m [35m[32mFile is new[0m[0m - [36mfile2.txt[0m-INFO : Path1: 2 changes: [32m 1 new[0m, [33m 1 modified[0m, [31m 0 deleted[0m+INFO : Path1: 1 changes: [32m 0 new[0m, [33m 1 modified[0m, [31m 0 deleted[0mINFO : ([33mModified[0m: [36m 0 newer[0m, [34m 1 older[0m)INFO : Path2 checking for diffsINFO : - [34mPath2[0m [35m[33mFile changed: [35mtime (older)[0m[0m[0m - [36mfile1.txt[0m-INFO : - [34mPath2[0m [35m[32mFile is new[0m[0m - [36mfile2.txt[0m-INFO : Path2: 2 changes: [32m 1 new[0m, [33m 1 modified[0m, [31m 0 deleted[0m+INFO : Path2: 1 changes: [32m 0 new[0m, [33m 1 modified[0m, [31m 0 deleted[0mINFO : ([33mModified[0m: [36m 0 newer[0m, [34m 1 older[0m)INFO : Applying changesINFO : Checking potential conflicts...ERROR : file1.txt: {hashtype} differNOTICE: {path2String}: 1 differences foundNOTICE: {path2String}: 1 errors while checking-NOTICE: {path2String}: 1 matching filesINFO : Finished checking the potential conflicts. 1 differences foundNOTICE: - [34mWARNING[0m [35mNew or changed in both paths[0m - [36mfile1.txt[0mINFO : file1.txt: Path1 is newer. Path1: 2004-07-25 00:00:00 +0000 UTC, Path2: 2004-07-23 00:00:00 +0000 UTC, Difference: 48h0m0s@@ -351,8 +350,6 @@ NOTICE: - [36mPath1[0m [35mNot renaming Path1 copy, as it was determined tNOTICE: - [36mPath1[0m [35m[32mQueue copy to[0m Path2[0m - [36m{path2/}file1.txt[0mNOTICE: - [34mPath2[0m [35mRenaming Path2 copy[0m - [36m{path2/}file1.txt.path2[0mNOTICE: - [34mPath2[0m [35m[32mQueue copy to[0m Path1[0m - [36m{path1/}file1.txt.path2[0m-NOTICE: - [34mWARNING[0m [35mNew or changed in both paths[0m - [36mfile2.txt[0m-INFO : Files are equal! Skipping: file2.txtINFO : - [34mPath2[0m [35mDo queued copies to[0m - [36mPath1[0mINFO : - [36mPath1[0m [35mDo queued copies to[0m - [36mPath2[0mINFO : Updating listingsdiff --git a/docs/content/bisync.md b/docs/content/bisync.mdindex 0f7382d78..6d3f42a0a 100644--- a/docs/content/bisync.md+++ b/docs/content/bisync.md@@ -1937,6 +1937,8 @@ about *Unison* and synchronization in general.- Added `--max-delete-renames-aware` to exclude guaranteed tracked renames fromthe `--max-delete` safety check when used with `--track-renames`.+- Fixed an issue causing the conflict winner to be missing from listings when+Path2 won.### `v1.74.2`