~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

Merge from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
345
345
        t = get_transport(self.get_url()).clone('wrong-first-parent')
346
346
        d = bzrlib.bzrdir.BzrDir.open_from_transport(t)
347
347
        repo = d.open_repository()
348
 
        g = repo.get_revision_graph()
349
 
        if tuple(g['wrong-first-parent']) == ('1', '2'):
350
 
            raise TestSkipped('wrong-first-parent is not setup for testing')
 
348
        repo.lock_read()
 
349
        try:
 
350
            g = repo.get_graph()
 
351
            if g.get_parent_map(['wrong-first-parent'])['wrong-first-parent'] \
 
352
                == ('1', '2'):
 
353
                raise TestSkipped('wrong-first-parent is not setup for testing')
 
354
        finally:
 
355
            repo.unlock()
351
356
        self.checkUnreconciled(d, repo.reconcile())
352
357
        # nothing should have been altered yet : inventories without
353
358
        # revisions are not data loss incurring for current format
357
362
        # and no garbage inventories
358
363
        self.assertEqual(0, reconciler.garbage_inventories)
359
364
        # and should have been fixed:
360
 
        g = repo.get_revision_graph()
361
 
        self.assertEqual(('1', '2'), g['wrong-first-parent'])
 
365
        repo.lock_read()
 
366
        self.addCleanup(repo.unlock)
 
367
        g = repo.get_graph()
 
368
        self.assertEqual(
 
369
            {'wrong-first-parent':('1', '2')},
 
370
            g.get_parent_map(['wrong-first-parent']))
362
371
 
363
372
    def test_reconcile_wrong_order_secondary_inventory(self):
364
373
        # a wrong order in the parents for inventories is ignored.