~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Ross Lagerwall
  • Date: 2012-08-07 06:32:51 UTC
  • mto: (6437.63.5 2.5)
  • mto: This revision was merged to the branch mainline in revision 6558.
  • Revision ID: rosslagerwall@gmail.com-20120807063251-x9p03ghg2ws8oqjc
Add bzrlib/locale to .bzrignore

bzrlib/locale is generated with ./setup.py build_mo which is in turn called
by ./setup.py build

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
"""Tests for reconciliation of repositories."""
18
18
 
19
19
import bzrlib
20
 
from bzrlib import (
21
 
    errors,
22
 
    )
23
 
from bzrlib.bzrdir import BzrDir
 
20
from bzrlib import errors
24
21
from bzrlib.inventory import Inventory
25
22
from bzrlib.reconcile import reconcile, Reconciler
26
23
from bzrlib.revision import Revision
138
135
        # a inventory with a ghost that can be corrected now.
139
136
        t.copy_tree('inventory_one_ghost', 'inventory_ghost_present')
140
137
        bzrdir_url = self.get_url('inventory_ghost_present')
141
 
        bzrdir = BzrDir.open(bzrdir_url)
 
138
        bzrdir = bzrlib.bzrdir.BzrDir.open(bzrdir_url)
142
139
        repo = bzrdir.open_repository()
143
140
        add_commit(repo, 'the_ghost', [])
144
141
 
145
142
    def checkEmptyReconcile(self, **kwargs):
146
143
        """Check a reconcile on an empty repository."""
147
144
        self.make_repository('empty')
148
 
        d = BzrDir.open(self.get_url('empty'))
 
145
        d = bzrlib.bzrdir.BzrDir.open(self.get_url('empty'))
149
146
        # calling on a empty repository should do nothing
150
147
        reconciler = d.find_repository().reconcile(**kwargs)
151
148
        # no inconsistent parents should have been found
170
167
    def test_convenience_reconcile_inventory_without_revision_reconcile(self):
171
168
        # smoke test for the all in one ui tool
172
169
        bzrdir_url = self.get_url('inventory_without_revision')
173
 
        bzrdir = BzrDir.open(bzrdir_url)
 
170
        bzrdir = bzrlib.bzrdir.BzrDir.open(bzrdir_url)
174
171
        repo = bzrdir.open_repository()
175
172
        if not repo._reconcile_does_inventory_gc:
176
173
            raise TestSkipped('Irrelevant test')
182
179
    def test_reweave_inventory_without_revision(self):
183
180
        # an excess inventory on its own is only reconciled by using thorough
184
181
        d_url = self.get_url('inventory_without_revision')
185
 
        d = BzrDir.open(d_url)
 
182
        d = bzrlib.bzrdir.BzrDir.open(d_url)
186
183
        repo = d.open_repository()
187
184
        if not repo._reconcile_does_inventory_gc:
188
185
            raise TestSkipped('Irrelevant test')
235
232
        # smoke test for the all in one Reconciler class,
236
233
        # other tests use the lower level repo.reconcile()
237
234
        d_url = self.get_url('inventory_without_revision_and_ghost')
238
 
        d = BzrDir.open(d_url)
 
235
        d = bzrlib.bzrdir.BzrDir.open(d_url)
239
236
        if not d.open_repository()._reconcile_does_inventory_gc:
240
237
            raise TestSkipped('Irrelevant test')
241
238
        def reconcile():
247
244
    def test_reweave_inventory_without_revision_and_ghost(self):
248
245
        # actual low level test.
249
246
        d_url = self.get_url('inventory_without_revision_and_ghost')
250
 
        d = BzrDir.open(d_url)
 
247
        d = bzrlib.bzrdir.BzrDir.open(d_url)
251
248
        repo = d.open_repository()
252
249
        if not repo._reconcile_does_inventory_gc:
253
250
            raise TestSkipped('Irrelevant test')
257
254
            thorough=True)
258
255
 
259
256
    def test_reweave_inventory_preserves_a_revision_with_ghosts(self):
260
 
        d = BzrDir.open(self.get_url('inventory_one_ghost'))
 
257
        d = bzrlib.bzrdir.BzrDir.open(self.get_url('inventory_one_ghost'))
261
258
        reconciler = d.open_repository().reconcile(thorough=True)
262
259
        # no inconsistent parents should have been found:
263
260
        # the lack of a parent for ghost is normal
270
267
        self.assertThat(['ghost', 'the_ghost'], MatchesAncestry(repo, 'ghost'))
271
268
 
272
269
    def test_reweave_inventory_fixes_ancestryfor_a_present_ghost(self):
273
 
        d = BzrDir.open(self.get_url('inventory_ghost_present'))
 
270
        d = bzrlib.bzrdir.BzrDir.open(self.get_url('inventory_ghost_present'))
274
271
        repo = d.open_repository()
275
272
        m = MatchesAncestry(repo, 'ghost')
276
273
        if m.match(['the_ghost', 'ghost']) is None: