~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: John Arbash Meinel
  • Date: 2009-02-23 15:29:35 UTC
  • mfrom: (3943.7.7 bzr.code_style_cleanup)
  • mto: This revision was merged to the branch mainline in revision 4033.
  • Revision ID: john@arbash-meinel.com-20090223152935-oel9m92mwcc6nb4h
Merge the removal of all trailing whitespace, and resolve conflicts.

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
 
        # Remote repository, and possibly others, do not have 
 
50
        # Remote repository, and possibly others, do not have
51
51
        # _transport.
52
52
        if getattr(repo, '_transport', None) is not None:
53
53
            for path in repo._transport.list_dir('.'):
58
58
 
59
59
    def setUp(self):
60
60
        super(TestsNeedingReweave, self).setUp()
61
 
        
 
61
 
62
62
        t = get_transport(self.get_url())
63
63
        # an empty inventory with no revision for testing with.
64
64
        repo = self.make_repository('inventory_without_revision')
104
104
        # i.e. a ghost.
105
105
        repo = self.make_repository('inventory_one_ghost')
106
106
        add_commit(repo, 'ghost', ['the_ghost'])
107
 
         
 
107
 
108
108
        # a inventory with a ghost that can be corrected now.
109
109
        t.copy_tree('inventory_one_ghost', 'inventory_ghost_present')
110
110
        bzrdir_url = self.get_url('inventory_ghost_present')
231
231
    def test_reweave_inventory_preserves_a_revision_with_ghosts(self):
232
232
        d = bzrlib.bzrdir.BzrDir.open(self.get_url('inventory_one_ghost'))
233
233
        reconciler = d.open_repository().reconcile(thorough=True)
234
 
        # no inconsistent parents should have been found: 
 
234
        # no inconsistent parents should have been found:
235
235
        # the lack of a parent for ghost is normal
236
236
        self.assertEqual(0, reconciler.inconsistent_parents)
237
237
        # and one garbage inventories
240
240
        repo = d.open_repository()
241
241
        repo.get_inventory('ghost')
242
242
        self.assertEqual([None, 'ghost'], repo.get_ancestry('ghost'))
243
 
        
 
243
 
244
244
    def test_reweave_inventory_fixes_ancestryfor_a_present_ghost(self):
245
245
        d = bzrlib.bzrdir.BzrDir.open(self.get_url('inventory_ghost_present'))
246
246
        repo = d.open_repository()
275
275
    def setUp(self):
276
276
        self.reduceLockdirTimeout()
277
277
        super(TestReconcileWithIncorrectRevisionCache, self).setUp()
278
 
        
 
278
 
279
279
        t = get_transport(self.get_url())
280
280
        # we need a revision with two parents in the wrong order
281
281
        # which should trigger reinsertion.
286
286
        # there is no api to construct a broken knit repository at
287
287
        # this point. if we ever encounter a bad graph in a knit repo
288
288
        # we should add a lower level api to allow constructing such cases.
289
 
        
 
289
 
290
290
        # first off the common logic:
291
291
        tree = self.make_branch_and_tree('wrong-first-parent')
292
292
        second_tree = self.make_branch_and_tree('reversed-secondary-parents')