~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Patch Queue Manager
  • Date: 2013-06-24 13:05:33 UTC
  • mfrom: (6578.1.1 2.6-merges-2.5)
  • Revision ID: pqm@pqm.ubuntu.com-20130624130533-51c8htekjd8mix3u
(jameinel) Merge bzr/2.5 into trunk,
 including the fix for bug #855155 (John A Meinel)

Show diffs side-by-side

added added

removed removed

Lines of Context:
450
450
            self.add_dir(new_shape, new_revid, 'root-id', None, '')
451
451
 
452
452
    def assertTransitionFromBasisToShape(self, basis_shape, basis_revid,
453
 
        new_shape, new_revid, extra_parent=None):
 
453
        new_shape, new_revid, extra_parent=None, set_current_inventory=True):
454
454
        # set the inventory revision ids.
455
455
        basis_shape.revision_id = basis_revid
456
456
        new_shape.revision_id = new_revid
465
465
                parents.append(extra_parent)
466
466
            tree.set_parent_ids(parents)
467
467
        self.fake_up_revision(tree, new_revid, new_shape)
468
 
        # give tree an inventory of new_shape
469
 
        tree._write_inventory(new_shape)
 
468
        if set_current_inventory:
 
469
            # give tree an inventory of new_shape
 
470
            tree._write_inventory(new_shape)
470
471
        self.assertDeltaApplicationResultsInExpectedBasis(tree, new_revid,
471
472
            delta, new_shape)
472
473
        # The tree should be internally consistent; while this is a moderately
764
765
        self.add_link(new_shape, old_revid, 'link-id-C', 'dir-id-B', 'C', 'D')
765
766
        self.assertTransitionFromBasisToShape(basis_shape, old_revid,
766
767
            new_shape, new_revid)
 
768
 
 
769
    def test_add_files_to_empty_directory(self):
 
770
        old_revid = 'old-parent'
 
771
        basis_shape = Inventory(root_id=None)
 
772
        self.add_dir(basis_shape, old_revid, 'root-id', None, '')
 
773
        self.add_dir(basis_shape, old_revid, 'dir-id-A', 'root-id', 'A')
 
774
        new_revid = 'new-parent'
 
775
        new_shape = Inventory(root_id=None)
 
776
        self.add_new_root(new_shape, old_revid, new_revid)
 
777
        self.add_dir(new_shape, old_revid, 'dir-id-A', 'root-id', 'A')
 
778
        self.add_file(new_shape, new_revid, 'file-id-B', 'dir-id-A', 'B',
 
779
            '1' * 32, 24)
 
780
        self.assertTransitionFromBasisToShape(basis_shape, old_revid,
 
781
                new_shape, new_revid, set_current_inventory=False)