borgbackup/src/borg
Elmar Hoffmann 3e50ca8b63 make constants for files cache mode more clear (#6724)
* make constants for files cache mode more clear

Traditionally, DEFAULT_FILES_CACHE_MODE_UI and DEFAULT_FILES_CACHE_MODE
were - as the naming scheme implies - the same setting, one being the UI
representation as given to the --files-cache command line option and the
other being the same default value in the internal representation.

It happended that the actual value used in borg create always comes from
DEFAULT_FILES_CACHE_MODE_UI (because that does have the --files-cache
option) whereas for all other commands (that do not use the files cache) it
comes from DEFAULT_FILES_CACHE_MODE.

PR #5777 then abused this fact to implement the optimisation to skip loading
of the files cache in those other commands by changing the value of
DEFAULT_FILES_CACHE_MODE to disabled.
This however also changes the meaning of that variable and thus redesignates
it to something not matching the original naming anymore.

Anyone not aware of this change and the intention behind it looking at the
code would have a hard time figuring this out and be easily mislead.

This does away with the confusion making the code more maintainable by
renaming DEFAULT_FILES_CACHE_MODE to FILES_CACHE_MODE_DISABLED, making the
new intention of that internal default clear.

* make constant for files cache mode UI default match naming scheme
2022-05-30 15:34:08 +02:00
..
algorithms 1.1: Make switch fallthrough explicit 2022-03-10 07:48:23 +03:00
cache_sync 1.1: Make switch fallthrough explicit 2022-03-10 07:48:23 +03:00
crypto give a more helpful error msg for unsupported key format, fixes #6561 2022-04-24 22:28:58 +02:00
platform SaveFile: respect umask for final file mode, fixes #6400 2022-03-09 17:20:43 +01:00
testsuite Fix typos (#6688) 2022-05-15 23:41:57 +02:00
__init__.py Fix typos (backport of #5597) 2021-06-16 10:25:43 -05:00
__main__.py move borg package to src/ 2016-05-05 20:19:50 +02:00
_chunker.c add parens for C preprocessor macro argument usages 2017-12-15 00:50:06 +01:00
_endian.h create _endian.h 2017-07-11 19:12:19 +02:00
_hashindex.c fix bug in hashindex_set on resize, fixes #4829 2020-03-01 16:40:53 +01:00
archive.py show_progress: add finished=true/false to archive_progress json, fixes #6570 2022-05-08 18:38:45 +02:00
archiver.py make constants for files cache mode more clear (#6724) 2022-05-30 15:34:08 +02:00
cache.py make constants for files cache mode more clear (#6724) 2022-05-30 15:34:08 +02:00
chunker.pyx add "# cython: language_level=3" directive to .pyx files, fixes #4214 2019-01-05 20:12:32 +01:00
compress.pyx Fix typos (#6688) 2022-05-15 23:41:57 +02:00
constants.py make constants for files cache mode more clear (#6724) 2022-05-30 15:34:08 +02:00
fuse.py mount -o versions: give clear error msg instead of crashing 2022-05-15 00:45:59 +02:00
hashindex.pyx implement more standard hashindex.setdefault behaviour 2022-02-20 18:37:31 +03:00
helpers.py do not load files cache for commands not using it, fixes #5673 2022-04-19 21:11:52 +02:00
item.pyx Merge pull request #5496 from ThomasWaldmann/item-assert-dict 2020-12-04 16:06:04 -06:00
locking.py Fix typos (backport of #5597) 2021-06-16 10:25:43 -05:00
logger.py Fix typos (backport of #5597) 2021-06-16 10:25:43 -05:00
lrucache.py lrucache: regularly remove old FDs, fixes #4427 2019-03-19 18:52:19 +01:00
nanorst.py nanorst: add missing blank to exception message 2018-07-13 10:44:17 +02:00
paperkey.html Fix typos (backport of #5597) 2021-06-16 10:25:43 -05:00
patterns.py Use an exception catching to avoid a stack trace 2021-08-14 10:12:31 +02:00
remote.py rename truncate_and_unlink to safe_unlink 2022-02-20 21:31:23 +03:00
repository.py Merge pull request #6621 from ThomasWaldmann/secure-erase-msg-1.1 2022-04-18 10:01:23 +02:00
selftest.py check that borg does not require pytest for normal usage, fixes #6563 2022-05-07 18:55:04 +02:00
shellpattern.py Moving the flags of the compiled regex to the front to fix #4137 2018-11-02 00:37:35 +01:00
upgrader.py fix ProgressIndicator msgids, fixes #4935 2020-02-29 20:39:27 +01:00
version.py version: add missing test for format_version, fix bug 2017-06-27 10:11:57 +02:00
xattr.py no libc filename fallback on the BSDs 2021-06-30 00:26:08 +02:00