~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/bzrdir_implementations/test_bzrdir.py

First cut at pluralised VersionedFiles. Some rather massive API incompatabilities, primarily because of the difficulty of coherence among competing stores.

Show diffs side-by-side

added added

removed removed

Lines of Context:
125
125
                    self.assertEqual(left_repo.get_revision(rev_id),
126
126
                        right_repo.get_revision(rev_id))
127
127
                # inventories
128
 
                left_inv_weave = left_repo.get_inventory_weave()
129
 
                right_inv_weave = right_repo.get_inventory_weave()
130
 
                self.assertEqual(set(left_inv_weave.versions()),
131
 
                    set(right_inv_weave.versions()))
 
128
                left_inv_weave = left_repo.inventories
 
129
                right_inv_weave = right_repo.inventories
 
130
                self.assertEqual(set(left_inv_weave.keys()),
 
131
                    set(right_inv_weave.keys()))
132
132
                # XXX: currently this does not handle indirectly referenced
133
133
                # inventories (e.g. where the inventory is a delta basis for
134
134
                # one that is fully present but that the revid for that
135
135
                # inventory is not yet present.)
136
 
                self.assertEqual(set(left_inv_weave.versions()), set(all_revs))
 
136
                self.assertEqual(set(left_inv_weave.keys()),
 
137
                    set(left_repo.revisions.keys()))
137
138
                left_trees = left_repo.revision_trees(all_revs)
138
139
                right_trees = right_repo.revision_trees(all_revs)
139
140
                for left_tree, right_tree in izip(left_trees, right_trees):
142
143
                text_index = left_repo._generate_text_key_index()
143
144
                self.assertEqual(text_index,
144
145
                    right_repo._generate_text_key_index())
 
146
                desired_files = []
145
147
                for file_id, revision_id in text_index.iterkeys():
146
 
                    left_weave = left_repo.weave_store.get_weave(
147
 
                        file_id, left_repo.get_transaction())
148
 
                    right_weave = right_repo.weave_store.get_weave(
149
 
                        file_id, right_repo.get_transaction())
150
 
                    self.assertEqual(
151
 
                        left_weave.get_text(revision_id),
152
 
                        right_weave.get_text(revision_id))
 
148
                    desired_files.append(
 
149
                        (file_id, revision_id, (file_id, revision_id)))
 
150
                left_texts = list(left_repo.iter_files_bytes(desired_files))
 
151
                right_texts = list(right_repo.iter_files_bytes(desired_files))
 
152
                left_texts.sort()
 
153
                right_texts.sort()
 
154
                self.assertEqual(left_texts, right_texts)
153
155
                # signatures
154
156
                for rev_id in all_revs:
155
157
                    try:
306
308
                                     './.bzr/merge-hashes',
307
309
                                     './.bzr/repository',
308
310
                                     ])
309
 
        self.assertRepositoryHasSameItems(tree.branch.repository, repo)
 
311
        self.assertRepositoryHasSameItems(tree.branch.repository,
 
312
            target.open_repository())
310
313
 
311
314
    def test_clone_bzrdir_repository_under_shared(self):
312
315
        tree = self.make_branch_and_tree('commit_tree')