diff --git a/NEWS b/NEWS index 92333826..d019c5bf 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,8 @@ 1.4.16 - * Fix for missing Healthchecks monitoring payload or HTTP 500 due to incorrect unicode encoding. + * #257: Fix for garbled Borg file listing when using "borgmatic create --progress" with + verbosity level 1 or 2. + * #260: Fix for missing Healthchecks monitoring payload or HTTP 500 due to incorrect unicode + encoding. 1.4.15 * Fix for database dump removal incorrectly skipping some database dumps. diff --git a/borgmatic/borg/create.py b/borgmatic/borg/create.py index f3e8c2ad..3190a8fc 100644 --- a/borgmatic/borg/create.py +++ b/borgmatic/borg/create.py @@ -170,7 +170,11 @@ 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) and not json else ()) + + ( + ('--list', '--filter', 'AME-') + if logger.isEnabledFor(logging.INFO) and not json and not progress + else () + ) + (('--info',) if logger.getEffectiveLevel() == logging.INFO and not json else ()) + ( ('--stats',) diff --git a/tests/unit/borg/test_create.py b/tests/unit/borg/test_create.py index 156be573..d2cb12f0 100644 --- a/tests/unit/borg/test_create.py +++ b/tests/unit/borg/test_create.py @@ -821,6 +821,31 @@ def test_create_archive_with_stats_calls_borg_with_stats_parameter(): ) +def test_create_archive_with_progress_and_log_info_calls_borg_with_progress_parameter_and_no_list(): + flexmock(module).should_receive('borgmatic_source_directories').and_return([]) + flexmock(module).should_receive('_expand_directories').and_return(('foo', 'bar')) + flexmock(module).should_receive('_expand_home_directories').and_return(()) + flexmock(module).should_receive('_write_pattern_file').and_return(None) + flexmock(module).should_receive('_make_pattern_flags').and_return(()) + flexmock(module).should_receive('_make_exclude_flags').and_return(()) + flexmock(module).should_receive('execute_command_without_capture').with_args( + ('borg', 'create', '--info', '--stats', '--progress') + ARCHIVE_WITH_PATHS + ) + insert_logging_mock(logging.INFO) + + module.create_archive( + dry_run=False, + repository='repo', + location_config={ + 'source_directories': ['foo', 'bar'], + 'repositories': ['repo'], + 'exclude_patterns': None, + }, + storage_config={}, + progress=True, + ) + + def test_create_archive_with_progress_calls_borg_with_progress_parameter(): flexmock(module).should_receive('borgmatic_source_directories').and_return([]) flexmock(module).should_receive('_expand_directories').and_return(('foo', 'bar'))