~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/repository_implementations/test_reconcile.py

  • Committer: Robert Collins
  • Date: 2007-08-08 05:37:51 UTC
  • mto: (2592.3.95 repository)
  • mto: This revision was merged to the branch mainline in revision 2743.
  • Revision ID: robertc@robertcollins.net-20070808053751-72npeyouas425fck
Review feedback.

Show diffs side-by-side

added added

removed removed

Lines of Context:
127
127
        # in an empty repo, theres nothing to do.
128
128
        self.checkEmptyReconcile()
129
129
 
130
 
    def test_reconcile_actions(self):
131
 
        """reconcile_actions() returns a set naming what a repo reconciles."""
 
130
    def test_repo_has_reconcile_does_inventory_gc_attribute(self):
132
131
        repo = self.make_repository('repo')
133
 
        self.assertNotEqual(None, set(repo.reconcile_actions()))
 
132
        self.assertNotEqual(None, repo._reconcile_does_inventory_gc)
134
133
 
135
134
    def test_reconcile_empty_thorough(self):
136
135
        # reconcile should accept thorough=True
141
140
        bzrdir_url = self.get_url('inventory_without_revision')
142
141
        bzrdir = bzrlib.bzrdir.BzrDir.open(bzrdir_url)
143
142
        repo = bzrdir.open_repository()
144
 
        if 'inventory_gc' not in repo.reconcile_actions():
145
 
            # irrelevant test.
146
 
            return
 
143
        if not repo._reconcile_does_inventory_gc:
 
144
            raise TestSkipped('Irrelevant test')
147
145
        reconcile(bzrdir)
148
146
        # now the backup should have it but not the current inventory
149
147
        repo = bzrdir.open_repository()
154
152
        d_url = self.get_url('inventory_without_revision')
155
153
        d = bzrlib.bzrdir.BzrDir.open(d_url)
156
154
        repo = d.open_repository()
157
 
        if 'inventory_gc' not in repo.reconcile_actions():
158
 
            # irrelevant test.
159
 
            return
 
155
        if not repo._reconcile_does_inventory_gc:
 
156
            raise TestSkipped('Irrelevant test')
160
157
        self.checkUnreconciled(d, repo.reconcile())
161
158
        reconciler = repo.reconcile(thorough=True)
162
159
        # no bad parents
206
203
        # other tests use the lower level repo.reconcile()
207
204
        d_url = self.get_url('inventory_without_revision_and_ghost')
208
205
        d = bzrlib.bzrdir.BzrDir.open(d_url)
209
 
        if 'inventory_gc' not in d.open_repository().reconcile_actions():
210
 
            # irrelevant test.
211
 
            return
 
206
        if not d.open_repository()._reconcile_does_inventory_gc:
 
207
            raise TestSkipped('Irrelevant test')
212
208
        def reconcile():
213
209
            reconciler = Reconciler(d)
214
210
            reconciler.reconcile()
220
216
        d_url = self.get_url('inventory_without_revision_and_ghost')
221
217
        d = bzrlib.bzrdir.BzrDir.open(d_url)
222
218
        repo = d.open_repository()
223
 
        if 'inventory_gc' not in repo.reconcile_actions():
224
 
            # irrelevant test.
225
 
            return
 
219
        if not repo._reconcile_does_inventory_gc:
 
220
            raise TestSkipped('Irrelevant test')
226
221
        # nothing should have been altered yet : inventories without
227
222
        # revisions are not data loss incurring for current format
228
223
        self.check_thorough_reweave_missing_revision(d, repo.reconcile,