~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/bzrdir_implementations/test_bzrdir.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-11-17 18:07:42 UTC
  • mfrom: (2991.1.4 50582)
  • Revision ID: pqm@pqm.ubuntu.com-20071117180742-59zhz30s7839y41j
(Daniel Watkins) bzrdir.clone() should respect a target repositories
        no-trees setting.

Show diffs side-by-side

added added

removed removed

Lines of Context:
525
525
        self.skipIfNoWorkingTree(target)
526
526
        self.assertEqual(['1'], target.open_workingtree().get_parent_ids())
527
527
 
 
528
    def test_clone_bzrdir_into_notrees_repo(self):
 
529
        """Cloning into a no-trees repo should not create a working tree"""
 
530
        tree = self.make_branch_and_tree('source')
 
531
        self.build_tree(['source/foo'])
 
532
        tree.add('foo')
 
533
        tree.commit('revision 1')
 
534
 
 
535
        try:
 
536
            repo = self.make_repository('repo', shared=True)
 
537
        except errors.IncompatibleFormat:
 
538
            raise TestNotApplicable('must support shared repositories')
 
539
        if repo.make_working_trees():
 
540
            repo.set_make_working_trees(False)
 
541
            self.assertFalse(repo.make_working_trees())
 
542
 
 
543
        dir = tree.bzrdir
 
544
        a_dir = dir.clone(self.get_url('repo/a'))
 
545
        a_dir.open_branch()
 
546
        self.assertRaises(errors.NoWorkingTree, a_dir.open_workingtree)
 
547
 
528
548
    def test_get_branch_reference_on_reference(self):
529
549
        """get_branch_reference should return the right url."""
530
550
        referenced_branch = self.make_branch('referenced')