Browse Source

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

Dan Helfman 1 week ago
parent
commit
7417a3cd00
4 changed files with 9 additions and 6 deletions
  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 View File

@@ -1,3 +1,6 @@
1
+1.2.12.dev0
2
+ * #111: Update Borg create --filter values so a dry run lists files to back up.
3
+
1 4
 1.2.11
2 5
  * #108: Support for Borg create --progress via borgmatic command-line flag.
3 6
 

+ 1
- 1
borgmatic/borg/create.py View File

@@ -147,7 +147,7 @@ def create_archive(
147 147
         + (('--remote-path', remote_path) if remote_path else ())
148 148
         + (('--umask', str(umask)) if umask else ())
149 149
         + (('--lock-wait', str(lock_wait)) if lock_wait else ())
150
-        + (('--list', '--filter', 'AME') if logger.isEnabledFor(logging.INFO) else ())
150
+        + (('--list', '--filter', 'AME-') if logger.isEnabledFor(logging.INFO) else ())
151 151
         + (('--info',) if logger.getEffectiveLevel() == logging.INFO else ())
152 152
         + (('--stats',) if not dry_run and logger.isEnabledFor(logging.INFO) else ())
153 153
         + (('--debug', '--show-rc') if logger.isEnabledFor(logging.DEBUG) else ())

+ 1
- 1
setup.py View File

@@ -1,7 +1,7 @@
1 1
 from setuptools import setup, find_packages
2 2
 
3 3
 
4
-VERSION = '1.2.11'
4
+VERSION = '1.2.12.dev0'
5 5
 
6 6
 
7 7
 setup(

+ 4
- 4
tests/unit/borg/test_create.py View File

@@ -266,7 +266,7 @@ def test_create_archive_with_log_info_calls_borg_with_info_parameter():
266 266
     flexmock(module).should_receive('_make_pattern_flags').and_return(())
267 267
     flexmock(module).should_receive('_make_pattern_flags').and_return(())
268 268
     flexmock(module).should_receive('_make_exclude_flags').and_return(())
269
-    insert_subprocess_mock(CREATE_COMMAND + ('--list', '--filter', 'AME', '--info', '--stats'))
269
+    insert_subprocess_mock(CREATE_COMMAND + ('--list', '--filter', 'AME-', '--info', '--stats'))
270 270
     insert_logging_mock(logging.INFO)
271 271
 
272 272
     module.create_archive(
@@ -287,7 +287,7 @@ def test_create_archive_with_log_debug_calls_borg_with_debug_parameter():
287 287
     flexmock(module).should_receive('_make_pattern_flags').and_return(())
288 288
     flexmock(module).should_receive('_make_exclude_flags').and_return(())
289 289
     insert_subprocess_mock(
290
-        CREATE_COMMAND + ('--list', '--filter', 'AME', '--stats', '--debug', '--show-rc')
290
+        CREATE_COMMAND + ('--list', '--filter', 'AME-', '--stats', '--debug', '--show-rc')
291 291
     )
292 292
     insert_logging_mock(logging.DEBUG)
293 293
 
@@ -331,7 +331,7 @@ def test_create_archive_with_dry_run_and_log_info_calls_borg_without_stats_param
331 331
     flexmock(module).should_receive('_make_pattern_flags').and_return(())
332 332
     flexmock(module).should_receive('_make_pattern_flags').and_return(())
333 333
     flexmock(module).should_receive('_make_exclude_flags').and_return(())
334
-    insert_subprocess_mock(CREATE_COMMAND + ('--list', '--filter', 'AME', '--info', '--dry-run'))
334
+    insert_subprocess_mock(CREATE_COMMAND + ('--list', '--filter', 'AME-', '--info', '--dry-run'))
335 335
     insert_logging_mock(logging.INFO)
336 336
 
337 337
     module.create_archive(
@@ -355,7 +355,7 @@ def test_create_archive_with_dry_run_and_log_debug_calls_borg_without_stats_para
355 355
     flexmock(module).should_receive('_make_pattern_flags').and_return(())
356 356
     flexmock(module).should_receive('_make_exclude_flags').and_return(())
357 357
     insert_subprocess_mock(
358
-        CREATE_COMMAND + ('--list', '--filter', 'AME', '--debug', '--show-rc', '--dry-run')
358
+        CREATE_COMMAND + ('--list', '--filter', 'AME-', '--debug', '--show-rc', '--dry-run')
359 359
     )
360 360
     insert_logging_mock(logging.DEBUG)
361 361
 

Loading…
Cancel
Save