~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_foreign.py

  • Committer: Jelmer Vernooij
  • Date: 2012-04-16 11:08:11 UTC
  • mfrom: (6521 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6522.
  • Revision ID: jelmer@samba.org-20120416110811-0y996ihqy9o2bb1t
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
205
205
                        rev.timezone, rev.committer, rev.properties,
206
206
                        new_revid)
207
207
                try:
208
 
                    for path, ie in tree.inventory.iter_entries():
 
208
                    parent_tree = self.target.repository.revision_tree(
 
209
                        parent_revid)
 
210
                    for path, ie in tree.iter_entries_by_dir():
209
211
                        new_ie = ie.copy()
210
212
                        new_ie.revision = None
211
213
                        builder.record_entry_contents(new_ie, 
212
 
                            [self.target.repository.revision_tree(parent_revid).inventory],
 
214
                            [parent_tree.root_inventory],
213
215
                            path, tree, 
214
216
                            (ie.kind, ie.text_size, ie.executable, ie.text_sha1))
215
217
                    builder.finish_inventory()
328
330
 
329
331
    def cloning_metadir(self, stacked=False):
330
332
        """Produce a metadir suitable for cloning with."""
331
 
        return bzrdir.format_registry.make_bzrdir("default")
 
333
        return controldir.format_registry.make_bzrdir("default")
332
334
 
333
335
    def checkout_metadir(self):
334
336
        return self.cloning_metadir()
429
431
        foreign.update_workingtree_fileids(wt, target_basis)
430
432
        wt.lock_read()
431
433
        try:
432
 
            self.assertEquals(set([root_id, "bla-b"]), set(wt.inventory))
 
434
            self.assertEquals(set([root_id, "bla-b"]), set(wt.all_file_ids()))
433
435
        finally:
434
436
            wt.unlock()
435
437
 
444
446
    def test_create(self):
445
447
        """Test we can create dummies."""
446
448
        self.make_branch_and_tree("d", format=DummyForeignVcsDirFormat())
447
 
        dir = bzrdir.BzrDir.open("d")
 
449
        dir = controldir.ControlDir.open("d")
448
450
        self.assertEquals("A Dummy VCS Dir", dir._format.get_format_string())
449
451
        dir.open_repository()
450
452
        dir.open_branch()
453
455
    def test_sprout(self):
454
456
        """Test we can clone dummies and that the format is not preserved."""
455
457
        self.make_branch_and_tree("d", format=DummyForeignVcsDirFormat())
456
 
        dir = bzrdir.BzrDir.open("d")
 
458
        dir = controldir.ControlDir.open("d")
457
459
        newdir = dir.sprout("e")
458
460
        self.assertNotEquals("A Dummy VCS Dir",
459
461
                             newdir._format.get_format_string())