Browse Source

remove csize from summarize return tuple

Thomas Waldmann 3 years ago
parent
commit
0211948cac
3 changed files with 4 additions and 4 deletions
  1. 1 1
      src/borg/cache.py
  2. 2 2
      src/borg/hashindex.pyx
  3. 1 1
      src/borg/testsuite/hashindex.py

+ 1 - 1
src/borg/cache.py

@@ -423,7 +423,7 @@ Chunk index:    {0.total_unique_chunks:20d} {0.total_chunks:20d}"""
     def stats(self):
         from .archive import Archive
         # XXX: this should really be moved down to `hashindex.pyx`
-        total_size, _, unique_size, _, total_unique_chunks, total_chunks = self.chunks.summarize()
+        total_size, unique_size, total_unique_chunks, total_chunks = self.chunks.summarize()
         # the above values have the problem that they do not consider part files,
         # thus the total_size might be too high (chunks referenced
         # by the part files AND by the complete file).

+ 2 - 2
src/borg/hashindex.pyx

@@ -358,7 +358,7 @@ cdef class ChunkIndex(IndexBase):
         return iter
 
     def summarize(self):
-        cdef uint64_t size = 0, csize = 0, unique_size = 0, unique_csize = 0, chunks = 0, unique_chunks = 0
+        cdef uint64_t size = 0, unique_size = 0, chunks = 0, unique_chunks = 0
         cdef uint32_t *values
         cdef uint32_t refcount
         cdef unsigned char *key = NULL
@@ -375,7 +375,7 @@ cdef class ChunkIndex(IndexBase):
             unique_size += _le32toh(values[1])
             size += <uint64_t> _le32toh(values[1]) * _le32toh(values[0])
 
-        return size, csize, unique_size, unique_csize, unique_chunks, chunks
+        return size, unique_size, unique_chunks, chunks
 
     def stats_against(self, ChunkIndex master_index):
         """

+ 1 - 1
src/borg/testsuite/hashindex.py

@@ -147,7 +147,7 @@ class HashIndexTestCase(BaseTestCase):
         idx[H(2)] = 2, 2000, 200
         idx[H(3)] = 3, 3000, 300
 
-        size, _, unique_size, _, unique_chunks, chunks = idx.summarize()
+        size, unique_size, unique_chunks, chunks = idx.summarize()
         assert size == 1000 + 2 * 2000 + 3 * 3000
         assert unique_size == 1000 + 2000 + 3000
         assert chunks == 1 + 2 + 3