From d64bcd5e83990e9682815ba8f4abad73c4ca564f Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Tue, 17 Dec 2019 20:12:41 -0800 Subject: [PATCH] When pruning with verbosity level 1, list pruned and kept archives. --- NEWS | 2 ++ borgmatic/borg/prune.py | 2 +- tests/unit/borg/test_prune.py | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index dd1c953..f27b9b1 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,8 @@ * #268: Override particular configuration options from the command-line via "--override" flag. See the documentation for more information: https://torsion.org/borgmatic/docs/how-to/make-per-application-backups/#configuration-overrides + * When pruning with verbosity level 1, list pruned and kept archives. Previously, this information + was only shown at verbosity level 2. 1.4.20 * Fix repository probing during "borgmatic init" to respect verbosity flag and remote_path option. diff --git a/borgmatic/borg/prune.py b/borgmatic/borg/prune.py index 0913cde..2c4811e 100644 --- a/borgmatic/borg/prune.py +++ b/borgmatic/borg/prune.py @@ -58,7 +58,7 @@ def prune_archives( + (('--umask', str(umask)) if umask else ()) + (('--lock-wait', str(lock_wait)) if lock_wait else ()) + (('--stats',) if not dry_run and logger.isEnabledFor(logging.INFO) else ()) - + (('--info',) if logger.getEffectiveLevel() == logging.INFO else ()) + + (('--info', '--list') if logger.getEffectiveLevel() == logging.INFO else ()) + (('--debug', '--list', '--show-rc') if logger.isEnabledFor(logging.DEBUG) else ()) + (('--dry-run',) if dry_run else ()) + (('--stats',) if stats else ()) diff --git a/tests/unit/borg/test_prune.py b/tests/unit/borg/test_prune.py index 80cce83..b2b4785 100644 --- a/tests/unit/borg/test_prune.py +++ b/tests/unit/borg/test_prune.py @@ -75,7 +75,9 @@ def test_prune_archives_with_log_info_calls_borg_with_info_parameter(): flexmock(module).should_receive('_make_prune_flags').with_args(retention_config).and_return( BASE_PRUNE_FLAGS ) - insert_execute_command_mock(PRUNE_COMMAND + ('--stats', '--info', 'repo'), logging.INFO) + insert_execute_command_mock( + PRUNE_COMMAND + ('--stats', '--info', '--list', 'repo'), logging.INFO + ) insert_logging_mock(logging.INFO) module.prune_archives(