~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/repository_implementations/test_reconcile.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:
47
47
    def checkNoBackupInventory(self, aBzrDir):
48
48
        """Check that there is no backup inventory in aBzrDir."""
49
49
        repo = aBzrDir.open_repository()
50
 
        self.assertRaises(errors.NoSuchFile,
51
 
                          repo.control_weaves.get_weave,
52
 
                          'inventory.backup',
53
 
                          repo.get_transaction())
 
50
        # Remote repository, and possibly others, do not have 
 
51
        # _transport.
 
52
        if getattr(repo, '_transport', None) is not None:
 
53
            for path in repo._transport.list_dir('.'):
 
54
                self.assertFalse('inventory.backup' in path)
54
55
 
55
56
 
56
57
class TestsNeedingReweave(TestReconcile):
76
77
            inv.root.revision = revision_id
77
78
            root_id = inv.root.file_id
78
79
            sha1 = repo.add_inventory(revision_id, inv, parent_ids)
79
 
            vf = repo.weave_store.get_weave_or_empty(root_id,
80
 
                repo.get_transaction())
81
 
            vf.add_lines(revision_id, [], [])
 
80
            repo.texts.add_lines((root_id, revision_id), [], [])
82
81
            rev = bzrlib.revision.Revision(timestamp=0,
83
82
                                           timezone=None,
84
83
                                           committer="Foo Bar <foo@example.com>",
195
194
 
196
195
    def check_missing_was_removed(self, repo):
197
196
        if repo._reconcile_backsup_inventory:
198
 
            backup = repo.control_weaves.get_weave('inventory.backup',
199
 
                                                   repo.get_transaction())
200
 
            self.assertTrue('missing' in backup.versions())
201
 
        self.assertRaises(errors.RevisionNotPresent,
202
 
                          repo.get_inventory, 'missing')
 
197
            backed_up = False
 
198
            for path in repo._transport.list_dir('.'):
 
199
                if 'inventory.backup' in path:
 
200
                    backed_up = True
 
201
            self.assertTrue(backed_up)
 
202
            # Not clear how to do this at an interface level:
 
203
            # self.assertTrue('missing' in backup.versions())
 
204
        self.assertRaises(errors.NoSuchRevision, repo.get_inventory, 'missing')
203
205
 
204
206
    def test_reweave_inventory_without_revision_reconciler(self):
205
207
        # smoke test for the all in one Reconciler class,
325
327
        inv.root.revision = 'wrong-secondary-parent'
326
328
        if repo.supports_rich_root():
327
329
            root_id = inv.root.file_id
328
 
            vf = repo.weave_store.get_weave_or_empty(root_id,
329
 
                repo.get_transaction())
330
 
            vf.add_lines('wrong-secondary-parent', [], [])
 
330
            repo.texts.add_lines((root_id, 'wrong-secondary-parent'), [], [])
331
331
        sha1 = repo.add_inventory('wrong-secondary-parent', inv, ['1', '3', '2'])
332
332
        rev = Revision(timestamp=0,
333
333
                       timezone=None,