From c6582e1171c43a15a2b086e7e77ab335817b3f83 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Sun, 26 Feb 2023 17:17:25 -0800 Subject: [PATCH] Internally support new Borg 2.0.0b5 "--filter" status characters / item flags for the "create" action. --- NEWS | 2 ++ borgmatic/borg/create.py | 2 +- tests/unit/borg/test_create.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 8fad15f..e197767 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,8 @@ * #621: Add optional authentication to the ntfy monitoring hook. * With the "create" action, only one of "--list" ("--files") and "--progress" flags can be used. This lines up with the new behavior in Borg 2.0.0b5. + * Internally support new Borg 2.0.0b5 "--filter" status characters / item flags for the "create" + action. 1.7.7 * #642: Add MySQL database hook "add_drop_database" configuration option to control whether dumped diff --git a/borgmatic/borg/create.py b/borgmatic/borg/create.py index 75baf66..a85f71e 100644 --- a/borgmatic/borg/create.py +++ b/borgmatic/borg/create.py @@ -399,7 +399,7 @@ def create_archive( + (('--remote-path', remote_path) if remote_path else ()) + (('--umask', str(umask)) if umask else ()) + (('--lock-wait', str(lock_wait)) if lock_wait else ()) - + (('--list', '--filter', 'AMEx-') if list_files and not json and not progress else ()) + + (('--list', '--filter', 'AMEx+-') if list_files and not json and not progress else ()) + (('--dry-run',) if dry_run else ()) + (tuple(extra_borg_options.split(' ')) if extra_borg_options else ()) + flags.make_repository_archive_flags(repository, archive_name_format, local_borg_version) diff --git a/tests/unit/borg/test_create.py b/tests/unit/borg/test_create.py index d853e2d..7a6d5e8 100644 --- a/tests/unit/borg/test_create.py +++ b/tests/unit/borg/test_create.py @@ -1612,7 +1612,7 @@ def test_create_archive_with_files_calls_borg_with_list_parameter_and_answer_out ) flexmock(module.environment).should_receive('make_environment') flexmock(module).should_receive('execute_command').with_args( - ('borg', 'create', '--list', '--filter', 'AMEx-') + REPO_ARCHIVE_WITH_PATHS, + ('borg', 'create', '--list', '--filter', 'AMEx+-') + REPO_ARCHIVE_WITH_PATHS, output_log_level=module.borgmatic.logger.ANSWER, output_file=None, borg_local_path='borg',