684
684
class Test2a(TestCaseWithTransport):
686
def test_fetch_combines_groups(self):
687
builder = self.make_branch_builder('source', format='2a')
688
builder.start_series()
689
builder.build_snapshot('1', None, [
690
('add', ('', 'root-id', 'directory', '')),
691
('add', ('file', 'file-id', 'file', 'content\n'))])
692
builder.build_snapshot('2', ['1'], [
693
('modify', ('file-id', 'content-2\n'))])
694
builder.finish_series()
695
source = builder.get_branch()
696
target = self.make_repository('target', format='2a')
697
target.fetch(source.repository)
699
self.addCleanup(target.unlock)
700
details = target.texts._index.get_build_details(
701
[('file-id', '1',), ('file-id', '2',)])
702
file_1_details = details[('file-id', '1')]
703
file_2_details = details[('file-id', '2')]
704
# The index, and what to read off disk, should be the same for both
705
# versions of the file.
706
self.assertEqual(file_1_details[0][:3], file_2_details[0][:3])
686
708
def test_format_pack_compresses_True(self):
687
709
repo = self.make_repository('repo', format='2a')
688
710
self.assertTrue(repo._format.pack_compresses)