/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_repository.py

  • Committer: Martin Pool
  • Date: 2009-09-11 07:55:48 UTC
  • mfrom: (4634.43.1 2.0)
  • mto: This revision was merged to the branch mainline in revision 4689.
  • Revision ID: mbp@sourcefrog.net-20090911075548-kzznjy7emvpqnz1n
merge 2.0rc2, sphinx, and various fixes back to trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
727
727
        # versions of the file.
728
728
        self.assertEqual(file_1_details[0][:3], file_2_details[0][:3])
729
729
 
 
730
    def test_fetch_combines_groups(self):
 
731
        builder = self.make_branch_builder('source', format='2a')
 
732
        builder.start_series()
 
733
        builder.build_snapshot('1', None, [
 
734
            ('add', ('', 'root-id', 'directory', '')),
 
735
            ('add', ('file', 'file-id', 'file', 'content\n'))])
 
736
        builder.build_snapshot('2', ['1'], [
 
737
            ('modify', ('file-id', 'content-2\n'))])
 
738
        builder.finish_series()
 
739
        source = builder.get_branch()
 
740
        target = self.make_repository('target', format='2a')
 
741
        target.fetch(source.repository)
 
742
        target.lock_read()
 
743
        self.addCleanup(target.unlock)
 
744
        details = target.texts._index.get_build_details(
 
745
            [('file-id', '1',), ('file-id', '2',)])
 
746
        file_1_details = details[('file-id', '1')]
 
747
        file_2_details = details[('file-id', '2')]
 
748
        # The index, and what to read off disk, should be the same for both
 
749
        # versions of the file.
 
750
        self.assertEqual(file_1_details[0][:3], file_2_details[0][:3])
 
751
 
730
752
    def test_format_pack_compresses_True(self):
731
753
        repo = self.make_repository('repo', format='2a')
732
754
        self.assertTrue(repo._format.pack_compresses)
1008
1030
            inv = inventory.Inventory(revision_id='rev1a')
1009
1031
            inv.root.revision = 'rev1a'
1010
1032
            self.add_file(repo, inv, 'file1', 'rev1a', [])
 
1033
            repo.texts.add_lines((inv.root.file_id, 'rev1a'), [], [])
1011
1034
            repo.add_inventory('rev1a', inv, [])
1012
1035
            revision = _mod_revision.Revision('rev1a',
1013
1036
                committer='jrandom@example.com', timestamp=0,
1048
1071
    def add_revision(self, repo, revision_id, inv, parent_ids):
1049
1072
        inv.revision_id = revision_id
1050
1073
        inv.root.revision = revision_id
 
1074
        repo.texts.add_lines((inv.root.file_id, revision_id), [], [])
1051
1075
        repo.add_inventory(revision_id, inv, parent_ids)
1052
1076
        revision = _mod_revision.Revision(revision_id,
1053
1077
            committer='jrandom@example.com', timestamp=0, inventory_sha1='',