mirror of https://github.com/borgbackup/borg.git
dump-repo-objs: filename layout improvements
This commit is contained in:
parent
8738e85967
commit
24812b0317
|
@ -1943,7 +1943,7 @@ class Archiver:
|
||||||
segment_str = '_' + str(segment) if segment is not None else ''
|
segment_str = '_' + str(segment) if segment is not None else ''
|
||||||
offset_str = '_' + str(offset) if offset 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 ''
|
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)
|
print('Dumping', filename)
|
||||||
with open(filename, 'wb') as fd:
|
with open(filename, 'wb') as fd:
|
||||||
fd.write(data)
|
fd.write(data)
|
||||||
|
|
|
@ -2335,7 +2335,7 @@ class ArchiverTestCase(ArchiverTestCaseBase):
|
||||||
with changedir('output'):
|
with changedir('output'):
|
||||||
output = self.cmd('debug', 'dump-repo-objs', self.repository_location)
|
output = self.cmd('debug', 'dump-repo-objs', self.repository_location)
|
||||||
output_dir = sorted(os.listdir('output'))
|
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
|
assert 'Done.' in output
|
||||||
|
|
||||||
def test_debug_put_get_delete_obj(self):
|
def test_debug_put_get_delete_obj(self):
|
||||||
|
|
Loading…
Reference in New Issue