From 37f75519cf5d0d00c43b76d20a36223ab4846257 Mon Sep 17 00:00:00 2001 From: Simon Frei Date: Wed, 19 Jul 2017 13:55:14 +0200 Subject: [PATCH] Only style changes - still NOT functional --- src/borg/item.pyx | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/borg/item.pyx b/src/borg/item.pyx index 1f01bea2a..3d4f61fb1 100644 --- a/src/borg/item.pyx +++ b/src/borg/item.pyx @@ -365,9 +365,9 @@ class ManifestItem(PropDict): # indicated in compare_mode instead. if item1.get('deleted'): return 'added link' - elif item2.get('deleted'): + if item2.get('deleted'): return 'removed link' - elif 'source' in item1 and 'source' in item2 and item1.source != item2.source: + if 'source' in item1 and 'source' in item2 and item1.source != item2.source: return 'changed link' def compare_content(path, item1, item2): @@ -390,7 +390,7 @@ def compare_content(path, item1, item2): def compare_directory(item1, item2): if item2.get('deleted') and not item1.get('deleted'): return 'removed directory' - elif item1.get('deleted') and not item2.get('deleted'): + if item1.get('deleted') and not item2.get('deleted'): return 'added directory' def compare_owner(item1, item2): @@ -406,13 +406,11 @@ def compare_content(path, item1, item2): def contents_changed(item1, item2): if can_compare_chunk_ids: return item1.chunks != item2.chunks - else: - if sum_chunk_size(item1) != sum_chunk_size(item2): - return True - else: - chunk_ids1 = [c.id for c in item1.chunks] - chunk_ids2 = [c.id for c in item2.chunks] - return not fetch_and_compare_chunks(chunk_ids1, chunk_ids2, archive1, archive2) + if sum_chunk_size(item1) != sum_chunk_size(item2): + return True + chunk_ids1 = [c.id for c in item1.chunks] + chunk_ids2 = [c.id for c in item2.chunks] + return not fetch_and_compare_chunks(chunk_ids1, chunk_ids2, archive1, archive2) @staticmethod def compare_chunk_contents(chunks1, chunks2):