dump-repo-objs: filename layout improvements

This commit is contained in:
Thomas Waldmann 2018-05-31 14:55:43 +02:00
parent 8738e85967
commit 24812b0317
2 changed files with 2 additions and 2 deletions

View File

@ -1943,7 +1943,7 @@ class Archiver:
segment_str = '_' + str(segment) if segment is not None else ''
offset_str = '_' + str(offset) if offset is not None else ''
id_str = '_' + bin_to_hex(id) if id is not None else ''
filename = '%06d%s%s%s%s.obj' % (i, tag_str, segment_str, offset_str, id_str)
filename = '%08d%s%s%s%s.obj' % (i, segment_str, offset_str, tag_str, id_str)
print('Dumping', filename)
with open(filename, 'wb') as fd:
fd.write(data)

View File

@ -2335,7 +2335,7 @@ class ArchiverTestCase(ArchiverTestCaseBase):
with changedir('output'):
output = self.cmd('debug', 'dump-repo-objs', self.repository_location)
output_dir = sorted(os.listdir('output'))
assert len(output_dir) > 0 and output_dir[0].startswith('000000_')
assert len(output_dir) > 0 and output_dir[0].startswith('00000000_')
assert 'Done.' in output
def test_debug_put_get_delete_obj(self):