~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Samuel Bronson
  • Date: 2012-08-30 20:36:18 UTC
  • mto: (6015.57.3 2.4)
  • mto: This revision was merged to the branch mainline in revision 6558.
  • Revision ID: naesten@gmail.com-20120830203618-y2dzw91nqpvpgxvx
Update INSTALL for switch to Python 2.6 and up.

Show diffs side-by-side

added added

removed removed

Lines of Context:
349
349
        # we should add a lower level api to allow constructing such cases.
350
350
 
351
351
        # first off the common logic:
352
 
        self.first_tree = self.make_branch_and_tree('wrong-first-parent')
353
 
        self.second_tree = self.make_branch_and_tree(
354
 
            'reversed-secondary-parents')
355
 
        for t in [self.first_tree, self.second_tree]:
 
352
        tree = self.make_branch_and_tree('wrong-first-parent')
 
353
        second_tree = self.make_branch_and_tree('reversed-secondary-parents')
 
354
        for t in [tree, second_tree]:
356
355
            t.commit('1', rev_id='1')
357
356
            uncommit(t.branch, tree=t)
358
357
            t.commit('2', rev_id='2')
361
360
            uncommit(t.branch, tree=t)
362
361
        #second_tree = self.make_branch_and_tree('reversed-secondary-parents')
363
362
        #second_tree.pull(tree) # XXX won't copy the repo?
364
 
        repo_secondary = self.second_tree.branch.repository
 
363
        repo_secondary = second_tree.branch.repository
365
364
 
366
365
        # now setup the wrong-first parent case
367
 
        repo = self.first_tree.branch.repository
 
366
        repo = tree.branch.repository
368
367
        repo.lock_write()
369
368
        repo.start_write_group()
370
369
        inv = Inventory(revision_id='wrong-first-parent')
407
406
 
408
407
    def test_reconcile_wrong_order(self):
409
408
        # a wrong order in primary parents is optionally correctable
410
 
        repo = self.first_tree.branch.repository
 
409
        t = self.get_transport().clone('wrong-first-parent')
 
410
        d = bzrlib.bzrdir.BzrDir.open_from_transport(t)
 
411
        repo = d.open_repository()
411
412
        repo.lock_read()
412
413
        try:
413
414
            g = repo.get_graph()
416
417
                raise TestSkipped('wrong-first-parent is not setup for testing')
417
418
        finally:
418
419
            repo.unlock()
419
 
        self.checkUnreconciled(repo.bzrdir, repo.reconcile())
 
420
        self.checkUnreconciled(d, repo.reconcile())
420
421
        # nothing should have been altered yet : inventories without
421
422
        # revisions are not data loss incurring for current format
422
423
        reconciler = repo.reconcile(thorough=True)
434
435
 
435
436
    def test_reconcile_wrong_order_secondary_inventory(self):
436
437
        # a wrong order in the parents for inventories is ignored.
437
 
        repo = self.second_tree.branch.repository
438
 
        self.checkUnreconciled(repo.bzrdir, repo.reconcile())
439
 
        self.checkUnreconciled(repo.bzrdir, repo.reconcile(thorough=True))
 
438
        t = self.get_transport().clone('reversed-secondary-parents')
 
439
        d = bzrlib.bzrdir.BzrDir.open_from_transport(t)
 
440
        repo = d.open_repository()
 
441
        self.checkUnreconciled(d, repo.reconcile())
 
442
        self.checkUnreconciled(d, repo.reconcile(thorough=True))