فهرست منبع

Update Borg create --filter values so a dry run lists files to back up. (#111).

Dan Helfman 6 سال پیش
والد
کامیت
7417a3cd00
4فایلهای تغییر یافته به همراه9 افزوده شده و 6 حذف شده
  1. 3 0
      NEWS
  2. 1 1
      borgmatic/borg/create.py
  3. 1 1
      setup.py
  4. 4 4
      tests/unit/borg/test_create.py

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

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

+ 1 - 1
setup.py

@@ -1,7 +1,7 @@
 from setuptools import setup, find_packages
 
 
-VERSION = '1.2.11'
+VERSION = '1.2.12.dev0'
 
 
 setup(

+ 4 - 4
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)