~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Andrew Bennetts
  • Date: 2008-03-17 17:16:11 UTC
  • mfrom: (3290 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3756.
  • Revision ID: andrew.bennetts@canonical.com-20080317171611-o9wdrnf0m7qwo198
Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
249
249
        self.assertConsistentParents([first_revision, 'second'], tree)
250
250
 
251
251
 
252
 
class UpdateToOneParentViaDeltaTests(TestParents):
 
252
class UpdateToOneParentViaDeltaTests(TestCaseWithWorkingTree):
253
253
    """Tests for the update_basis_by_delta call.
254
254
    
255
255
    This is intuitively defined as 'apply an inventory delta to the basis and
514
514
        self.assertTransitionFromBasisToShape(basis_shape, old_revid,
515
515
            new_shape, new_revid)
516
516
 
 
517
    def test_parent_deleted_child_renamed(self):
 
518
        # test a A->None and A/B->A.
 
519
        old_revid = 'old-parent'
 
520
        basis_shape = Inventory(root_id=None)
 
521
        self.add_dir(basis_shape, old_revid, 'root-id', None, '')
 
522
        self.add_dir(basis_shape, old_revid, 'dir-id-A', 'root-id', 'A')
 
523
        self.add_dir(basis_shape, old_revid, 'dir-id-B', 'dir-id-A', 'B')
 
524
        self.add_link(basis_shape, old_revid, 'link-id-C', 'dir-id-B', 'C', 'C')
 
525
        new_revid = 'new-parent'
 
526
        new_shape = Inventory(root_id=None)
 
527
        self.add_new_root(new_shape, old_revid, new_revid)
 
528
        self.add_dir(new_shape, new_revid, 'dir-id-B', 'root-id', 'A')
 
529
        self.add_link(new_shape, old_revid, 'link-id-C', 'dir-id-B', 'C', 'C')
 
530
        self.assertTransitionFromBasisToShape(basis_shape, old_revid,
 
531
            new_shape, new_revid)
 
532
 
 
533
    def test_dir_to_root(self):
 
534
        # test a A->''.
 
535
        old_revid = 'old-parent'
 
536
        basis_shape = Inventory(root_id=None)
 
537
        self.add_dir(basis_shape, old_revid, 'root-id', None, '')
 
538
        self.add_dir(basis_shape, old_revid, 'dir-id-A', 'root-id', 'A')
 
539
        self.add_link(basis_shape, old_revid, 'link-id-B', 'dir-id-A', 'B', 'B')
 
540
        new_revid = 'new-parent'
 
541
        new_shape = Inventory(root_id=None)
 
542
        self.add_dir(new_shape, new_revid, 'dir-id-A', None, '')
 
543
        self.add_link(new_shape, old_revid, 'link-id-B', 'dir-id-A', 'B', 'B')
 
544
        self.assertTransitionFromBasisToShape(basis_shape, old_revid,
 
545
            new_shape, new_revid)
 
546
 
517
547
    def test_path_swap(self):
518
548
        # test a A->B and B->A path swap.
519
549
        old_revid = 'old-parent'