瀏覽代碼

When pruning with verbosity level 1, list pruned and kept archives.

Dan Helfman 5 年之前
父節點
當前提交
d64bcd5e83
共有 3 個文件被更改,包括 6 次插入2 次删除
  1. 2 0
      NEWS
  2. 1 1
      borgmatic/borg/prune.py
  3. 3 1
      tests/unit/borg/test_prune.py

+ 2 - 0
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.

+ 1 - 1
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 ())

+ 3 - 1
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(