~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Ian Clatworthy
  • Date: 2008-04-01 04:19:06 UTC
  • mfrom: (3302.6.1 xma-mailmode)
  • mto: This revision was merged to the branch mainline in revision 3323.
  • Revision ID: ian.clatworthy@canonical.com-20080401041906-s7ekpfpo0tnyfkbz
Add mail-mode GNU Emacs mail package as a mail client option (Xavier Maillard)

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
from bzrlib import (
18
 
    bzrdir,
19
18
    errors,
20
19
    tests,
21
20
    workingtree,
67
66
        branch = self.make_branch('branch')
68
67
        checkout = branch.create_checkout('checkout')
69
68
        self.run_bzr('reconfigure --lightweight-checkout checkout')
70
 
 
71
 
    def test_standalone_to_use_shared(self):
72
 
        self.build_tree(['repo/'])
73
 
        tree = self.make_branch_and_tree('repo/tree')
74
 
        repo = self.make_repository('repo', shared=True)
75
 
        self.run_bzr('reconfigure --use-shared', working_dir='repo/tree')
76
 
        tree = workingtree.WorkingTree.open('repo/tree')
77
 
        self.assertNotEqual(tree.bzrdir.root_transport.base,
78
 
            tree.branch.repository.bzrdir.root_transport.base)
79
 
 
80
 
    def test_use_shared_to_standalone(self):
81
 
        repo = self.make_repository('repo', shared=True)
82
 
        branch = bzrdir.BzrDir.create_branch_convenience('repo/tree')
83
 
        self.assertNotEqual(branch.bzrdir.root_transport.base,
84
 
            branch.repository.bzrdir.root_transport.base)
85
 
        self.run_bzr('reconfigure --standalone', working_dir='repo/tree')
86
 
        tree = workingtree.WorkingTree.open('repo/tree')
87
 
        self.assertEqual(tree.bzrdir.root_transport.base,
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')