/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/workingtree_implementations/test_parents.py

Merge bzr.dev r3466

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
                             _mod_revision.ensure_null(tree.last_revision()))
52
52
        else:
53
53
            self.assertEqual(expected[0], tree.last_revision())
54
 
        self.assertEqual(expected[1:],
55
 
            self.applyDeprecated(symbol_versioning.zero_eleven,
56
 
                tree.pending_merges))
57
54
 
58
55
 
59
56
class TestGetParents(TestParents):
249
246
        self.assertConsistentParents([first_revision, 'second'], tree)
250
247
 
251
248
 
252
 
class UpdateToOneParentViaDeltaTests(TestParents):
 
249
class UpdateToOneParentViaDeltaTests(TestCaseWithWorkingTree):
253
250
    """Tests for the update_basis_by_delta call.
254
251
    
255
252
    This is intuitively defined as 'apply an inventory delta to the basis and
514
511
        self.assertTransitionFromBasisToShape(basis_shape, old_revid,
515
512
            new_shape, new_revid)
516
513
 
 
514
    def test_parent_deleted_child_renamed(self):
 
515
        # test a A->None and A/B->A.
 
516
        old_revid = 'old-parent'
 
517
        basis_shape = Inventory(root_id=None)
 
518
        self.add_dir(basis_shape, old_revid, 'root-id', None, '')
 
519
        self.add_dir(basis_shape, old_revid, 'dir-id-A', 'root-id', 'A')
 
520
        self.add_dir(basis_shape, old_revid, 'dir-id-B', 'dir-id-A', 'B')
 
521
        self.add_link(basis_shape, old_revid, 'link-id-C', 'dir-id-B', 'C', 'C')
 
522
        new_revid = 'new-parent'
 
523
        new_shape = Inventory(root_id=None)
 
524
        self.add_new_root(new_shape, old_revid, new_revid)
 
525
        self.add_dir(new_shape, new_revid, 'dir-id-B', 'root-id', 'A')
 
526
        self.add_link(new_shape, old_revid, 'link-id-C', 'dir-id-B', 'C', 'C')
 
527
        self.assertTransitionFromBasisToShape(basis_shape, old_revid,
 
528
            new_shape, new_revid)
 
529
 
 
530
    def test_dir_to_root(self):
 
531
        # test a A->''.
 
532
        old_revid = 'old-parent'
 
533
        basis_shape = Inventory(root_id=None)
 
534
        self.add_dir(basis_shape, old_revid, 'root-id', None, '')
 
535
        self.add_dir(basis_shape, old_revid, 'dir-id-A', 'root-id', 'A')
 
536
        self.add_link(basis_shape, old_revid, 'link-id-B', 'dir-id-A', 'B', 'B')
 
537
        new_revid = 'new-parent'
 
538
        new_shape = Inventory(root_id=None)
 
539
        self.add_dir(new_shape, new_revid, 'dir-id-A', None, '')
 
540
        self.add_link(new_shape, old_revid, 'link-id-B', 'dir-id-A', 'B', 'B')
 
541
        self.assertTransitionFromBasisToShape(basis_shape, old_revid,
 
542
            new_shape, new_revid)
 
543
 
517
544
    def test_path_swap(self):
518
545
        # test a A->B and B->A path swap.
519
546
        old_revid = 'old-parent'