syncthing/lib/versioner
Eric P 6e768a8387 lib/versioner: Fix cleaning behaviour (fixes #7988) (#8537)
The cleaning logic in util.go was used by Simple and Trashcan but only
really suited Trashcan since it works based on mtimes which Simple does
not use. The cleaning logic in util.go was moved to trashcan.go.
Staggered and Simple seemed to be able to benefit from the same base so
util.go now has the base for those two with an added parameter which
takes a function so it can still handle versioner-specific logic to
decide which files to clean up. Simple now also correctly cleans files
based on their time-stamp in the title together with a specific maximum
amount to keep. The Archive function in Simple.go was changed to get rid
of duplicated code.

Additionally the trashcan testcase which was used by Trashcan as well as
Simple was moved from versioner_test.go to trashcan_test.go to keep it
clean, there was no need to keep it in a separate test file
2022-09-13 19:21:42 +02:00
..
_external_test lib/versioner: Test both spaces and parens in ext versioner paths 2016-09-18 12:24:55 +00:00
.gitignore mv internal lib 2015-08-09 09:35:26 +02:00
debug.go all, lib/logger: Refactor SetDebug calls (#6054) 2019-10-04 13:03:34 +02:00
empty_dir_tracker_test.go build: Update quic-go for Go 1.19 (#8483) 2022-08-03 15:43:26 +02:00
empty_dir_tracker.go lib/versioner: Purge the empty directories in .stversions (fixes #4406) 2017-11-18 15:56:53 +00:00
external_test.go all: Add build constants for runtime.GOOS comparisons (#8442) 2022-07-28 19:36:39 +02:00
external.go all: Add build constants for runtime.GOOS comparisons (#8442) 2022-07-28 19:36:39 +02:00
simple_test.go all: use T.TempDir to create temporary test directory (#8280) 2022-04-15 07:44:06 +04:00
simple.go lib/versioner: Fix cleaning behaviour (fixes #7988) (#8537) 2022-09-13 19:21:42 +02:00
staggered_test.go all: use T.TempDir to create temporary test directory (#8280) 2022-04-15 07:44:06 +04:00
staggered.go lib/versioner: Fix cleaning behaviour (fixes #7988) (#8537) 2022-09-13 19:21:42 +02:00
trashcan_test.go lib/versioner: Fix cleaning behaviour (fixes #7988) (#8537) 2022-09-13 19:21:42 +02:00
trashcan.go lib/versioner: Fix cleaning behaviour (fixes #7988) (#8537) 2022-09-13 19:21:42 +02:00
util.go lib/versioner: Fix cleaning behaviour (fixes #7988) (#8537) 2022-09-13 19:21:42 +02:00
versioner.go lib/versioner: Improve error messages (fixes #7354) (#7357) 2021-02-12 20:30:51 +01:00