diff --git a/NEWS b/NEWS index f8d1ab5b..4ed5d962 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ +1.2.12.dev0 + * #111: Update Borg create --filter values so a dry run lists files to back up. + 1.2.11 * #108: Support for Borg create --progress via borgmatic command-line flag. diff --git a/borgmatic/borg/create.py b/borgmatic/borg/create.py index eaf2e6e2..2b0af394 100644 --- a/borgmatic/borg/create.py +++ b/borgmatic/borg/create.py @@ -147,7 +147,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', 'AME') if logger.isEnabledFor(logging.INFO) else ()) + + (('--list', '--filter', 'AME-') if logger.isEnabledFor(logging.INFO) else ()) + (('--info',) if logger.getEffectiveLevel() == logging.INFO else ()) + (('--stats',) if not dry_run and logger.isEnabledFor(logging.INFO) else ()) + (('--debug', '--show-rc') if logger.isEnabledFor(logging.DEBUG) else ()) diff --git a/setup.py b/setup.py index 1ce77945..553a146a 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup, find_packages -VERSION = '1.2.11' +VERSION = '1.2.12.dev0' setup( diff --git a/tests/unit/borg/test_create.py b/tests/unit/borg/test_create.py index 2b3db1f9..f8840e5d 100644 --- a/tests/unit/borg/test_create.py +++ b/tests/unit/borg/test_create.py @@ -266,7 +266,7 @@ def test_create_archive_with_log_info_calls_borg_with_info_parameter(): flexmock(module).should_receive('_make_pattern_flags').and_return(()) flexmock(module).should_receive('_make_pattern_flags').and_return(()) flexmock(module).should_receive('_make_exclude_flags').and_return(()) - insert_subprocess_mock(CREATE_COMMAND + ('--list', '--filter', 'AME', '--info', '--stats')) + insert_subprocess_mock(CREATE_COMMAND + ('--list', '--filter', 'AME-', '--info', '--stats')) insert_logging_mock(logging.INFO) module.create_archive( @@ -287,7 +287,7 @@ def test_create_archive_with_log_debug_calls_borg_with_debug_parameter(): flexmock(module).should_receive('_make_pattern_flags').and_return(()) flexmock(module).should_receive('_make_exclude_flags').and_return(()) insert_subprocess_mock( - CREATE_COMMAND + ('--list', '--filter', 'AME', '--stats', '--debug', '--show-rc') + CREATE_COMMAND + ('--list', '--filter', 'AME-', '--stats', '--debug', '--show-rc') ) insert_logging_mock(logging.DEBUG) @@ -331,7 +331,7 @@ def test_create_archive_with_dry_run_and_log_info_calls_borg_without_stats_param flexmock(module).should_receive('_make_pattern_flags').and_return(()) flexmock(module).should_receive('_make_pattern_flags').and_return(()) flexmock(module).should_receive('_make_exclude_flags').and_return(()) - insert_subprocess_mock(CREATE_COMMAND + ('--list', '--filter', 'AME', '--info', '--dry-run')) + insert_subprocess_mock(CREATE_COMMAND + ('--list', '--filter', 'AME-', '--info', '--dry-run')) insert_logging_mock(logging.INFO) module.create_archive( @@ -355,7 +355,7 @@ def test_create_archive_with_dry_run_and_log_debug_calls_borg_without_stats_para flexmock(module).should_receive('_make_pattern_flags').and_return(()) flexmock(module).should_receive('_make_exclude_flags').and_return(()) insert_subprocess_mock( - CREATE_COMMAND + ('--list', '--filter', 'AME', '--debug', '--show-rc', '--dry-run') + CREATE_COMMAND + ('--list', '--filter', 'AME-', '--debug', '--show-rc', '--dry-run') ) insert_logging_mock(logging.DEBUG)