663
663
md5 = osutils.md5(upload_transport.get_bytes(expected_pack_name))
664
664
self.assertEqual(wg_tokens[0], md5.hexdigest())
666
def test_resume_chk_bytes(self):
667
self.vfs_transport_factory = memory.MemoryServer
668
repo = self.make_repository('repo', format=self.get_format())
669
if repo.chk_bytes is None:
670
raise TestNotApplicable('no chk_bytes for this repository')
671
expected_names.append(wg_tokens[0] + '.cix')
672
token = repo.lock_write()
673
self.addCleanup(repo.unlock)
674
repo.start_write_group()
675
text = 'a bit of text\n'
676
key = ('sha1:' + osutils.sha_string(text),)
677
repo.chk_bytes.add_lines(key, (), [text])
678
wg_tokens = repo.suspend_write_group()
679
same_repo = repo.bzrdir.open_repository()
680
same_repo.lock_write()
681
self.addCleanup(same_repo.unlock)
682
same_repo.resume_write_group(wg_tokens)
683
self.assertEqual([key], list(same_repo.chk_bytes.keys()))
685
text, same_repo.chk_bytes.get_record_stream([key],
686
'unordered', True).next().get_bytes_as('fulltext'))
687
same_repo.abort_write_group()
688
self.assertEqual([], list(same_repo.chk_bytes.keys()))
666
690
def test_resume_write_group_then_abort(self):
667
691
# Create a repo, start a write group, insert some data, suspend.
668
692
self.vfs_transport_factory = memory.MemoryServer
959
983
dict(format_name='development6-rich-root',
960
984
format_string='Bazaar development format - group compression '
961
985
'and chk inventory (needs bzr.dev from 1.14)\n',
962
format_supports_external_lookups=False,
986
format_supports_external_lookups=True,
963
987
index_class=BTreeGraphIndex),
965
989
# name of the scenario is the format name