Commit Graph

7107 Commits

Author SHA1 Message Date
Thomas Waldmann 7c82969761
mount: make up volname if not given (macOS), fixes #7690
macFUSE supports a volname mount option to give what
finder displays on desktop / in directory list.

if the user did not specify it, we make something up,
because otherwise it would be "macFUSE Volume 0 (Python)".
2023-06-30 22:10:32 +02:00
TW de53164931
Merge pull request #7689 from ThomasWaldmann/diff-surrogate-escape-1.2
diff: remove surrogates before output, fixes #7535
2023-06-30 17:52:26 +02:00
Thomas Waldmann c587e88830
diff: remove surrogates before output, fixes #7535 2023-06-30 17:10:56 +02:00
TW a0bc7b9434
Merge pull request #7683 from ThomasWaldmann/fix-repo-reopen-1.2
tests: fix repo reopen 1.2 (backport from master)
2023-06-28 00:24:41 +02:00
Thomas Waldmann fbf287f825
RepositoryTestCaseBase: remove need for "with" after reopen()
setUp enters the context manager, so let's .reopen() leave it.
then create a fresh Repository instance in self.repository and
enter the context manager again. tearDown then will leave that.
2023-06-27 22:43:00 +02:00
Thomas Waldmann 0ac07b7a3f
RepositoryTestCaseBase: call __exit__
As we call __enter__ in setUp,
let's call __exit__ in tearDown.
2023-06-27 22:34:11 +02:00
Thomas Waldmann 83b2b5cb6c
fix RepositoryTestCaseBase.reopen method
"if self.repository" did not work as expected:
- Repository has a __len__ method, so the boolean evaluation was calling that.
- self.repository is also not set to None anywhere.
2023-06-27 22:33:57 +02:00
TW 0947e9fb22
Merge pull request #7680 from ThomasWaldmann/improve-key-sanity-check-1.2
keyfile: improve key sanity check, fixes #7561
2023-06-27 22:32:30 +02:00
TW edc9a0843a
Merge pull request #7682 from ThomasWaldmann/test-cosmetics-1.2
tests: avoid long ids in pytest output
2023-06-27 22:30:16 +02:00
Thomas Waldmann 81588989fe
tests: avoid long ids in pytest output
sometimes the automatically computed IDs are just too long,
so rather give IDs directly or avoid them otherwise.
2023-06-27 21:50:51 +02:00
Thomas Waldmann a5801b9971
keyfile: improve key sanity check, fixes #7561
check key file structure, make sure the binary key
is not way too short (or zero) length.

if key file looks strange, emit warnings.
2023-06-27 21:39:43 +02:00
TW 1da5beacb3
Merge pull request #7678 from ThomasWaldmann/fix-crash-files-cache-size-1.2
--files-cache=size: fix crash, fixes #7658
2023-06-27 21:36:49 +02:00
TW c7d5fff200
Merge pull request #7679 from ThomasWaldmann/pypi-no-upload-signature-1.2
do not upload gpg signature to pypi, fixes #7649
2023-06-27 21:36:05 +02:00
TW f6805f3850
Merge pull request #7681 from ThomasWaldmann/fix-list-pattern-docs-1.2
list: fix --pattern examples, fixes #7611
2023-06-27 21:35:41 +02:00
Thomas Waldmann 893530fdac
list: fix --pattern examples, fixes #7611
- pattern needs to start with + - !
- first match wins
- the default is to list everything, thus a 2nd pattern
  is needed to exclude everything not matched by 1st pattern.
2023-06-27 21:00:05 +02:00
Thomas Waldmann de643c211b
do not upload gpg signature to pypi, fixes #7649 2023-06-27 18:45:41 +02:00
Thomas Waldmann 45aa88dbec
--files-cache=size: fix crash, fixes #7658 2023-06-27 18:40:48 +02:00
TW f73eb5c6c2
Merge pull request #7644 from eoli3n/1.2-maint
Backport of improvements in patterns help
2023-06-11 17:10:47 +02:00
eoli3n 91547e9844 improve patterns help: declarative includes sample 2023-06-11 11:14:24 +02:00
eoli3n 099f23032e improve patterns help: added pattern prefixes 2023-06-11 11:12:49 +02:00
eoli3n 3e8b0da8be improve patterns help: define a pattern style 2023-06-11 11:09:41 +02:00
eoli3n 952d778bc1 Improve patterns help 2023-06-11 11:08:31 +02:00
TW c5d579be39
Merge pull request #7628 from ThomasWaldmann/fix-chunksize-distrib-test-1.2
fix test_buzhash_chunksize_distribution
2023-06-06 11:25:11 +02:00
Thomas Waldmann 796d8e2d13
fix test_buzhash_chunksize_distribution
the last chunk can be smaller than 2**min_exp.
2023-06-06 10:46:53 +02:00
TW 742d0df294
Merge pull request #7613 from ThomasWaldmann/1.2-clear-empty-dirs-typo
fix typo
2023-05-29 15:22:15 +02:00
Thomas Waldmann e711df20e2
fix typo 2023-05-29 14:56:47 +02:00
TW 0bfbd8d8fc
Merge pull request #7595 from nain-F49FF806/1.2-clear-empty-dirs
clear empty directories at end of compact process, fixes #6823
2023-05-27 11:04:13 +02:00
nain aac55b1ad2 Add function to clear empty directories at end of compact process.
Compact moves data to new segments, and then removes the old segments.
When enough segments are moved, directories holding the now cleared segments
may thus become empty.

With this commit any empty directories are cleared after segments compacting.
Fixes #6823
2023-05-27 04:41:50 -04:00
TW 912dc81a2d
Merge pull request #7606 from nain-F49FF806/data-scandir-unify
unify scanning and listing of segment dirs, files and apply good practices
2023-05-27 10:31:36 +02:00
nain edb5e749f5 Move value bounds of segment (index) into constants module and use them instead 2023-05-27 02:33:53 -04:00
nain 3f2da1bba9 Simplify generator functions and make get_segment_dirs inputs consistent with get_segment_files
+ get_segment_dirs explicitly takes data_dir for clarity and future flexibility
+ removed multiple cases for one general purpose generator expression
2023-05-26 02:42:13 -04:00
nain c9f35a16e9 unify scanning and listing of segment dirs / segment files and apply good practices
+ os.scandir instead of os.listdir
  Improved speed and added flexibility with attributes (name,path,is_dir(),is_file())
+ use is_dir / is_file to make sure  we're reading only dirs / files respectively
+ Filtering to particular start, end index range built in
+ Have seperate generators to avoid unnecessary less_than / greater_than checking for every dir/file when not required

Resolves #7597
2023-05-25 11:55:16 -04:00
TW 53bedfb63b
Merge pull request #7589 from ThomasWaldmann/chunker-params-1.2
relax chunker params validation, tests (1.2-maint)
2023-05-19 19:19:04 +02:00
Thomas Waldmann 5cc4e3af6a
tests: only warn about "invalid" chunker params, fixes #7590
we previously allowed some weird chunker params, so we just warn
about them instead of rejecting them.

e.g. one could use super small chunk sizes. borg can do that,
but you'll end up with a huge amount of chunks and very large
hash tables (RAM usage) to manage them.

also, one can violate the min <= mask <= max chunker param condition
as in #7590 and it will somehow work, but will likely not dedup as good
as when not violating that.

borg2 **will** reject such strange chunker params, see #7586 for
some ideas how to "fix" your repos.
2023-05-19 18:05:26 +02:00
Thomas Waldmann 965e8a957f
tests: check buzhash chunksize distribution, see #7586 2023-05-19 18:05:20 +02:00
TW ce50796b1f
Merge pull request #7568 from elandorr/1.2-maint
incl./excl. options, path-from-stdin exclusiveness
2023-05-15 21:48:29 +02:00
elandorr 8e41831f4c
Update archiver.py 2023-05-15 11:39:10 +00:00
elandorr dedd58969c
mention paths-from-stdin's exclusiveness 2023-05-14 20:28:52 +00:00
elandorr 4047076e70
include/exclude options 2023-05-14 20:21:41 +00:00
TW 823f0fb9e0
Merge pull request #7564 from elandorr/1.2-maint
doc markup fixes
2023-05-14 18:58:42 +02:00
elandorr 6b38207aeb
markup fix + note about MAX_DATA_SIZE 2023-05-14 07:57:12 +00:00
elandorr f1bd5da8c9
escape 2023-05-14 07:50:27 +00:00
TW dbc142a32a
Merge pull request #7549 from sashadev-sky/fix-progress-msg-width-1.2
ProgressIndicatorPercent: fix space computation for wide chars, fixes #3027
2023-05-08 19:46:17 +02:00
Thomas Waldmann 21a9458848 ProgressIndicatorPercent: fix space computation for wide chars, fixes #3027
needs to use swidth() in case there are wide chars (like CJK)
in the left part of the msg (e.g. an archive name).

(cherry picked from commit 3dd14f4855)
2023-05-08 12:44:05 -04:00
TW 2181103c3f
Merge pull request #7550 from sashadev-sky/fix-argparse-errors-1.2
Fix argparse error messages
2023-05-08 15:39:11 +02:00
TW 1d4a7803dd
Merge pull request #7547 from sashadev-sky/issue-7476-1.2
Added pre-commit for linting purposes. Fixes #7476
2023-05-08 15:28:51 +02:00
Thomas Waldmann 3e9668ecbc fix CompressionSpec validator and tests
(cherry picked from commit 0b40e038ad)
2023-05-07 21:03:56 -04:00
Thomas Waldmann de199c23ab fix SortBySpec validator
(cherry picked from commit 05bf29f504)
2023-05-07 21:01:10 -04:00
Thomas Waldmann 7707ea538c fix FilesCacheMode validator
(cherry picked from commit 0f923c8c4a)
2023-05-07 21:00:20 -04:00
Thomas Waldmann 067e36bccc fix ChunkerParams validator and tests
(cherry picked from commit 6d38530ff1)
2023-05-07 20:59:17 -04:00