~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_reconfigure.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-02-16 17:24:48 UTC
  • mfrom: (4009.2.2 bzr.integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090216172448-vj35mjoe463c3bk2
(Matthew Fuller,
        Marius Kruger) Allow changing --[no-]trees with reconfigure

Show diffs side-by-side

added added

removed removed

Lines of Context:
86
86
        tree = workingtree.WorkingTree.open('repo/tree')
87
87
        self.assertEqual(tree.bzrdir.root_transport.base,
88
88
            tree.branch.repository.bzrdir.root_transport.base)
 
89
 
 
90
    def test_make_with_trees(self):
 
91
        repo = self.make_repository('repo', shared=True)
 
92
        repo.set_make_working_trees(False)
 
93
        self.run_bzr('reconfigure --with-trees', working_dir='repo')
 
94
        self.assertIs(True, repo.make_working_trees())
 
95
 
 
96
    def test_make_with_trees_already_trees(self):
 
97
        repo = self.make_repository('repo', shared=True)
 
98
        repo.set_make_working_trees(True)
 
99
        self.run_bzr_error([" already creates working trees"],
 
100
                            'reconfigure --with-trees repo')
 
101
 
 
102
    def test_make_without_trees(self):
 
103
        repo = self.make_repository('repo', shared=True)
 
104
        repo.set_make_working_trees(True)
 
105
        self.run_bzr('reconfigure --with-no-trees', working_dir='repo')
 
106
        self.assertIs(False, repo.make_working_trees())
 
107
 
 
108
    def test_make_without_trees_already_no_trees(self):
 
109
        repo = self.make_repository('repo', shared=True)
 
110
        repo.set_make_working_trees(False)
 
111
        self.run_bzr_error([" already doesn't create working trees"],
 
112
                            'reconfigure --with-no-trees repo')
 
113
 
 
114
    def test_make_with_trees_nonshared_repo(self):
 
115
        branch = self.make_branch('branch')
 
116
        self.run_bzr_error(
 
117
            ["Requested reconfiguration of '.*' is not supported"],
 
118
            'reconfigure --with-trees branch')
 
119
 
 
120
    def test_make_without_trees_leaves_tree_alone(self):
 
121
        repo = self.make_repository('repo', shared=True)
 
122
        branch = bzrdir.BzrDir.create_branch_convenience('repo/branch')
 
123
        tree = workingtree.WorkingTree.open('repo/branch')
 
124
        self.build_tree(['repo/branch/foo'])
 
125
        tree.add('foo')
 
126
        self.run_bzr('reconfigure --with-no-trees --force',
 
127
            working_dir='repo/branch')
 
128
        self.failUnlessExists('repo/branch/foo')
 
129
        tree = workingtree.WorkingTree.open('repo/branch')