mirror of
https://github.com/rclone/rclone.git
synced 2026-01-04 17:43:50 +00:00
bisync: equality check before renaming (leave identical files alone)
Improved detection of false positive change conflicts (identical files are now left alone instead of renamed) https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=1.%20Identical%20files%20should%20be%20left%20alone%2C%20even%20if%20new/newer/changed%20on%20both%20sides
This commit is contained in:
1
cmd/bisync/testdata/test_equal/golden/_testdir_path1.._testdir_path2.copy1to2.que
vendored
Normal file
1
cmd/bisync/testdata/test_equal/golden/_testdir_path1.._testdir_path2.copy1to2.que
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"file1.txt..path1"
|
||||
1
cmd/bisync/testdata/test_equal/golden/_testdir_path1.._testdir_path2.copy2to1.que
vendored
Normal file
1
cmd/bisync/testdata/test_equal/golden/_testdir_path1.._testdir_path2.copy2to1.que
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"file1.txt..path2"
|
||||
5
cmd/bisync/testdata/test_equal/golden/_testdir_path1.._testdir_path2.path1.lst
vendored
Normal file
5
cmd/bisync/testdata/test_equal/golden/_testdir_path1.._testdir_path2.path1.lst
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
# bisync listing v1 from test
|
||||
- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST"
|
||||
- 33 md5:ea683c03f780b76a62405456b08ae6fd - 2001-03-04T00:00:00.000000000+0000 "file1.txt..path1"
|
||||
- 33 md5:2b4975bb20f7be674e66d78570ba2fb1 - 2001-01-02T00:00:00.000000000+0000 "file1.txt..path2"
|
||||
- 37 md5:9fe822ddd1cb81d83aae00fa48239bd3 - 2001-01-02T00:00:00.000000000+0000 "file2.txt"
|
||||
4
cmd/bisync/testdata/test_equal/golden/_testdir_path1.._testdir_path2.path1.lst-new
vendored
Normal file
4
cmd/bisync/testdata/test_equal/golden/_testdir_path1.._testdir_path2.path1.lst-new
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
# bisync listing v1 from test
|
||||
- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST"
|
||||
- 33 md5:ea683c03f780b76a62405456b08ae6fd - 2001-03-04T00:00:00.000000000+0000 "file1.txt"
|
||||
- 37 md5:9fe822ddd1cb81d83aae00fa48239bd3 - 2001-01-02T00:00:00.000000000+0000 "file2.txt"
|
||||
5
cmd/bisync/testdata/test_equal/golden/_testdir_path1.._testdir_path2.path2.lst
vendored
Normal file
5
cmd/bisync/testdata/test_equal/golden/_testdir_path1.._testdir_path2.path2.lst
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
# bisync listing v1 from test
|
||||
- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST"
|
||||
- 33 md5:ea683c03f780b76a62405456b08ae6fd - 2001-03-04T00:00:00.000000000+0000 "file1.txt..path1"
|
||||
- 33 md5:2b4975bb20f7be674e66d78570ba2fb1 - 2001-01-02T00:00:00.000000000+0000 "file1.txt..path2"
|
||||
- 37 md5:9fe822ddd1cb81d83aae00fa48239bd3 - 2001-01-02T00:00:00.000000000+0000 "file2.txt"
|
||||
4
cmd/bisync/testdata/test_equal/golden/_testdir_path1.._testdir_path2.path2.lst-new
vendored
Normal file
4
cmd/bisync/testdata/test_equal/golden/_testdir_path1.._testdir_path2.path2.lst-new
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
# bisync listing v1 from test
|
||||
- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST"
|
||||
- 33 md5:2b4975bb20f7be674e66d78570ba2fb1 - 2001-01-02T00:00:00.000000000+0000 "file1.txt"
|
||||
- 37 md5:9fe822ddd1cb81d83aae00fa48239bd3 - 2001-01-02T00:00:00.000000000+0000 "file2.txt"
|
||||
52
cmd/bisync/testdata/test_equal/golden/test.log
vendored
Normal file
52
cmd/bisync/testdata/test_equal/golden/test.log
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
(01) : test equal
|
||||
|
||||
|
||||
(02) : test initial bisync
|
||||
(03) : bisync resync
|
||||
INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"
|
||||
INFO : Copying unique Path2 files to Path1
|
||||
INFO : Resynching Path1 to Path2
|
||||
INFO : Resync updating listings
|
||||
INFO : Bisync successful
|
||||
|
||||
(04) : test changed on both paths and NOT identical - file1 (file1R, file1L)
|
||||
(05) : touch-glob 2001-01-02 {datadir/} file1R.txt
|
||||
(06) : copy-as {datadir/}file1R.txt {path2/} file1.txt
|
||||
(07) : touch-glob 2001-03-04 {datadir/} file1L.txt
|
||||
(08) : copy-as {datadir/}file1L.txt {path1/} file1.txt
|
||||
|
||||
(09) : test changed on both paths and identical - file2
|
||||
(10) : touch-glob 2001-01-02 {datadir/} file2.txt
|
||||
(11) : copy-as {datadir/}file2.txt {path1/} file2.txt
|
||||
(12) : copy-as {datadir/}file2.txt {path2/} file2.txt
|
||||
|
||||
(13) : test bisync run
|
||||
(14) : bisync
|
||||
INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"
|
||||
INFO : Path1 checking for diffs
|
||||
INFO : - Path1 File is newer - file1.txt
|
||||
INFO : - Path1 File is newer - file2.txt
|
||||
INFO : Path1: 2 changes: 0 new, 2 newer, 0 older, 0 deleted
|
||||
INFO : Path2 checking for diffs
|
||||
INFO : - Path2 File is newer - file1.txt
|
||||
INFO : - Path2 File is newer - file2.txt
|
||||
INFO : Path2: 2 changes: 0 new, 2 newer, 0 older, 0 deleted
|
||||
INFO : Applying changes
|
||||
INFO : Checking potential conflicts...
|
||||
ERROR : file1.txt: md5 differ
|
||||
NOTICE: Local file system at {path2}: 1 differences found
|
||||
NOTICE: Local file system at {path2}: 1 errors while checking
|
||||
NOTICE: Local file system at {path2}: 1 matching files
|
||||
INFO : Finished checking the potential conflicts. 1 differences found
|
||||
NOTICE: - WARNING New or changed in both paths - file1.txt
|
||||
NOTICE: - Path1 Renaming Path1 copy - {path1/}file1.txt..path1
|
||||
NOTICE: - Path1 Queue copy to Path2 - {path2/}file1.txt..path1
|
||||
NOTICE: - Path2 Renaming Path2 copy - {path2/}file1.txt..path2
|
||||
NOTICE: - Path2 Queue copy to Path1 - {path1/}file1.txt..path2
|
||||
NOTICE: - WARNING New or changed in both paths - file2.txt
|
||||
INFO : Files are equal! Skipping: file2.txt
|
||||
INFO : - Path2 Do queued copies to - Path1
|
||||
INFO : - Path1 Do queued copies to - Path2
|
||||
INFO : Updating listings
|
||||
INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"
|
||||
INFO : Bisync successful
|
||||
1
cmd/bisync/testdata/test_equal/initial/RCLONE_TEST
vendored
Normal file
1
cmd/bisync/testdata/test_equal/initial/RCLONE_TEST
vendored
Normal file
@@ -0,0 +1 @@
|
||||
This file is used for testing the health of rclone accesses to the local/remote file system. Do not delete.
|
||||
0
cmd/bisync/testdata/test_equal/initial/file1.txt
vendored
Normal file
0
cmd/bisync/testdata/test_equal/initial/file1.txt
vendored
Normal file
0
cmd/bisync/testdata/test_equal/initial/file2.txt
vendored
Normal file
0
cmd/bisync/testdata/test_equal/initial/file2.txt
vendored
Normal file
1
cmd/bisync/testdata/test_equal/modfiles/file1L.txt
vendored
Normal file
1
cmd/bisync/testdata/test_equal/modfiles/file1L.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
This file is NOT identical to 1R
|
||||
1
cmd/bisync/testdata/test_equal/modfiles/file1R.txt
vendored
Normal file
1
cmd/bisync/testdata/test_equal/modfiles/file1R.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
This file is NOT identical to 1L
|
||||
1
cmd/bisync/testdata/test_equal/modfiles/file2.txt
vendored
Normal file
1
cmd/bisync/testdata/test_equal/modfiles/file2.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
This file is identical on both sides
|
||||
22
cmd/bisync/testdata/test_equal/scenario.txt
vendored
Normal file
22
cmd/bisync/testdata/test_equal/scenario.txt
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
test equal
|
||||
# Check that changed files on both sides are renamed ONLY if not-identical
|
||||
# See: https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=1.%20Identical%20files%20should%20be%20left%20alone%2C%20even%20if%20new/newer/changed%20on%20both%20sides
|
||||
# - Changed on Path2 and on Path1, and NOT identical file1 (file1r, file1l)
|
||||
# - Changed on Path2 and on Path1, and identical file2
|
||||
|
||||
test initial bisync
|
||||
bisync resync
|
||||
|
||||
test changed on both paths and NOT identical - file1 (file1R, file1L)
|
||||
touch-glob 2001-01-02 {datadir/} file1R.txt
|
||||
copy-as {datadir/}file1R.txt {path2/} file1.txt
|
||||
touch-glob 2001-03-04 {datadir/} file1L.txt
|
||||
copy-as {datadir/}file1L.txt {path1/} file1.txt
|
||||
|
||||
test changed on both paths and identical - file2
|
||||
touch-glob 2001-01-02 {datadir/} file2.txt
|
||||
copy-as {datadir/}file2.txt {path1/} file2.txt
|
||||
copy-as {datadir/}file2.txt {path2/} file2.txt
|
||||
|
||||
test bisync run
|
||||
bisync
|
||||
Reference in New Issue
Block a user