From e0fe766051e521396d7d58f973d1f8002ff749ad Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Tue, 28 Mar 2023 01:51:16 +0530 Subject: [PATCH] Added --content-only flag for borg 1.2.4 in diff view Signed-off-by: Chirag Aggarwal --- src/vorta/borg/_compatibility.py | 1 + src/vorta/borg/diff.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/vorta/borg/_compatibility.py b/src/vorta/borg/_compatibility.py index bf2a01b0..88aa3e8d 100644 --- a/src/vorta/borg/_compatibility.py +++ b/src/vorta/borg/_compatibility.py @@ -5,6 +5,7 @@ 'ZSTD': parse_version('1.1.4'), 'JSON_LOG': parse_version('1.1.0'), 'DIFF_JSON_LINES': parse_version('1.1.16'), + 'DIFF_CONTENT_ONLY': parse_version('1.2.4'), 'COMPACT_SUBCOMMAND': parse_version('1.2.0a1'), 'V122': parse_version('1.2.2'), 'V2': parse_version('2.0.0b1'), diff --git a/src/vorta/borg/diff.py b/src/vorta/borg/diff.py index b41c9783..2e98e1ff 100644 --- a/src/vorta/borg/diff.py +++ b/src/vorta/borg/diff.py @@ -28,6 +28,9 @@ def prepare(cls, profile, archive_name_1, archive_name_2): ret['cmd'].append('--json-lines') ret['json_lines'] = True + if borg_compat.check('DIFF_CONTENT_ONLY'): + ret['cmd'].append('--content-only') + if borg_compat.check('V2'): ret['cmd'].extend(['-r', profile.repo.url, archive_name_1, archive_name_2]) else: