From 3200190cdbeffd9ec9072a5990997f89eabd12b7 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Tue, 11 Oct 2022 19:44:11 +0200 Subject: [PATCH] diff: more precise warning msgs for different chunker params if we know both archives' chunker params, use "are different" not "might be". also do not recommend to enforce it using --same-chunker-params in this case. --- src/borg/archiver.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/borg/archiver.py b/src/borg/archiver.py index 2d7d8980b..404632688 100644 --- a/src/borg/archiver.py +++ b/src/borg/archiver.py @@ -1127,9 +1127,16 @@ class Archiver: cp1 = archive1.metadata.get('chunker_params') cp2 = archive2.metadata.get('chunker_params') - can_compare_chunk_ids = (args.same_chunker_params or - cp1 is not None and cp2 is not None and normalize_chunker_params(cp1) == normalize_chunker_params(cp2)) - if not can_compare_chunk_ids: + if args.same_chunker_params: + can_compare_chunk_ids = True # enforce it + elif cp1 is not None and cp2 is not None: + # we know chunker params of both archives + can_compare_chunk_ids = normalize_chunker_params(cp1) == normalize_chunker_params(cp2) + if not can_compare_chunk_ids: + self.print_warning('--chunker-params are different between archives, diff will be slow.') + else: + # we do not know chunker params of at least one of the archives + can_compare_chunk_ids = False self.print_warning('--chunker-params might be different between archives, diff will be slow.\n' 'If you know for certain that they are the same, pass --same-chunker-params ' 'to override this check.')