recreate: fix rechunking dropping all chunks on the floor

This commit is contained in:
Marian Beermann 2016-12-02 11:20:26 +01:00
parent b410392899
commit eb940e6779
2 changed files with 2 additions and 1 deletions

View file

@ -1528,7 +1528,7 @@ class ArchiveRecreater:
# The target.chunker will read the file contents through ChunkIteratorFileWrapper chunk-by-chunk
# (does not load the entire file into memory)
file = ChunkIteratorFileWrapper(chunk_iterator)
return target.chunker.chunkify(file)
yield from target.chunker.chunkify(file)
else:
for chunk in chunk_iterator:
yield chunk.data

View file

@ -1823,6 +1823,7 @@ class ArchiverTestCase(ArchiverTestCaseBase):
self.cmd('recreate', self.repository_location, '--chunker-params', 'default')
self.check_cache()
# test1 and test2 do deduplicate after recreate
assert int(self.cmd('list', self.repository_location + '::test1', 'input/large_file', '--format={size}'))
assert not int(self.cmd('list', self.repository_location + '::test1', 'input/large_file',
'--format', '{unique_chunks}'))