Browse Source

with_repository: fake mechanism not needed

was only used by borg create --dry-run, but that
internally does not use the repo anyway.
Thomas Waldmann 2 years ago
parent
commit
8562940b0d
2 changed files with 1 additions and 5 deletions
  1. 0 4
      src/borg/archiver/common.py
  2. 1 1
      src/borg/archiver/create.py

+ 0 - 4
src/borg/archiver/common.py

@@ -80,7 +80,6 @@ def compat_check(*, create, manifest, key, cache, compatibility, decorator_name)
 
 
 def with_repository(
-    fake=False,
     create=False,
     lock=True,
     exclusive=False,
@@ -93,7 +92,6 @@ def with_repository(
     Method decorator for subcommand-handling methods: do_XYZ(self, args, repository, …)
 
     If a parameter (where allowed) is a str the attribute named of args is used instead.
-    :param fake: (str or bool) use None instead of repository, don't do anything else
     :param create: create repository
     :param lock: lock repository
     :param exclusive: (bool) lock repository exclusively (for writing)
@@ -132,8 +130,6 @@ def with_repository(
             append_only = getattr(args, "append_only", False)
             storage_quota = getattr(args, "storage_quota", None)
             make_parent_dirs = getattr(args, "make_parent_dirs", False)
-            if argument(args, fake):
-                return method(self, args, repository=None, **kwargs)
 
             repository = get_repository(
                 location,

+ 1 - 1
src/borg/archiver/create.py

@@ -38,7 +38,7 @@ logger = create_logger()
 
 
 class CreateMixIn:
-    @with_repository(fake="dry_run", exclusive=True, compatibility=(Manifest.Operation.WRITE,))
+    @with_repository(exclusive=True, compatibility=(Manifest.Operation.WRITE,))
     def do_create(self, args, repository, manifest=None, key=None):
         """Create new archive"""
         matcher = PatternMatcher(fallback=True)