archiver: accept version 4 repos for -r/--repo, refs #8572

_common.py had a hard-coded version check that only allowed v3.
Now that repository.py creates v4 repos, every archiver command
failed to open the repo. Extend the guard to (3, 4).

The --other-repo check (v1 or v3 for borg transfer source) is
intentionally left unchanged.
This commit is contained in:
Mrityunjay Raj 2026-06-01 01:22:30 +05:30
parent 707f26b8e3
commit 395939b551

View file

@ -127,9 +127,9 @@ def with_repository(
)
with repository:
if repository.version not in (3,):
if repository.version not in (3, 4):
raise Error(
f"This borg version only accepts version 3 repos for -r/--repo, "
f"This borg version only accepts version 3 or 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."
)