I hope we don't have anything in the indexes that can't be recreated from the packs...
Anyway, about the empty pack files, here is a very crude script (you need to edit it to be able to use it in your case) that we should polish and include in bzr:
#!/usr/bin/env python
"""Repair a repo with an empty pack file.
"""
from bzrlib import repository, btree_index, transport
I hope we don't have anything in the indexes that can't be recreated from the packs...
Anyway, about the empty pack files, here is a very crude script (you need to edit it to be able to use it in your case) that we should polish and include in bzr:
#!/usr/bin/env python
"""Repair a repo with an empty pack file.
"""
from bzrlib import repository, btree_index, transport
t = transport. get_transport( '/repo/ .bzr/repository ') BTreeGraphIndex (t, 'pack-names', None) iter_all_ entries( )
pn_index = btree_index.
nodes = pn_index.
new_index = btree_index. BTreeBuilder( 0, 1)
for _, key, value in nodes: a51a7c4802f09d5 5b8d',) : add_node( key, value)
if key == ('128bb4cf175c5
continue
new_index.
new_index_content = new_index.finish() 'pack-names' , new_index_content)
t.put_file(