mirror of
https://github.com/borgbackup/borg.git
synced 2026-06-09 08:51:54 -04:00
archiver: v4-only for -r/--repo, accept v4 in --other-repo, fix TypeError in error message
This commit is contained in:
parent
395939b551
commit
2561acdba3
1 changed files with 4 additions and 4 deletions
|
|
@ -127,9 +127,9 @@ def with_repository(
|
|||
)
|
||||
|
||||
with repository:
|
||||
if repository.version not in (3, 4):
|
||||
if repository.version not in (4,):
|
||||
raise Error(
|
||||
f"This borg version only accepts version 3 or 4 repos for -r/--repo, "
|
||||
f"This borg version only accepts version 4 repos for -r/--repo, "
|
||||
f"but not version {repository.version}. "
|
||||
f"You can use 'borg transfer' to copy archives from old to new repos."
|
||||
)
|
||||
|
|
@ -194,10 +194,10 @@ def with_other_repository(manifest=False, cache=False, compatibility=None):
|
|||
)
|
||||
|
||||
with repository:
|
||||
acceptable_versions = (1,) if v1_legacy else (3,)
|
||||
acceptable_versions = (1,) if v1_legacy else (3, 4)
|
||||
if repository.version not in acceptable_versions:
|
||||
raise Error(
|
||||
f"This borg version only accepts version {' or '.join(acceptable_versions)} "
|
||||
f"This borg version only accepts version {' or '.join(str(v) for v in acceptable_versions)} "
|
||||
f"repos for --other-repo."
|
||||
)
|
||||
kwargs["other_repository"] = repository
|
||||
|
|
|
|||
Loading…
Reference in a new issue