~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: 2006-09-29 16:34:45 UTC
  • mfrom: (1551.8.37 Aaron's mergeable stuff)
  • Revision ID: pqm@pqm.ubuntu.com-20060929163445-4c546bbfc3328d82
Implement BzrDir.destroy_tree and destroy_tree_metadata

Show diffs side-by-side

added added

removed removed

Lines of Context:
153
153
        wt = dir.create_workingtree(revision_id=bzrlib.revision.NULL_REVISION)
154
154
        self.assertEqual([], wt.get_parent_ids())
155
155
 
 
156
    def test_destroy_workingtree(self):
 
157
        tree = self.make_branch_and_tree('tree')
 
158
        self.build_tree(['tree/file'])
 
159
        tree.add('file')
 
160
        tree.commit('first commit')
 
161
        bzrdir = tree.bzrdir
 
162
        try:
 
163
            bzrdir.destroy_workingtree()
 
164
        except errors.UnsupportedOperation:
 
165
            raise TestSkipped('Format does not support destroying tree')
 
166
        self.failIfExists('tree/file')
 
167
        self.assertRaises(errors.NoWorkingTree, bzrdir.open_workingtree)
 
168
        bzrdir.create_workingtree()
 
169
        self.failUnlessExists('tree/file')
 
170
        bzrdir.destroy_workingtree_metadata()
 
171
        self.failUnlessExists('tree/file')
 
172
        self.assertRaises(errors.NoWorkingTree, bzrdir.open_workingtree)
 
173
            
156
174
    def test_clone_bzrdir_empty(self):
157
175
        dir = self.make_bzrdir('source')
158
176
        target = dir.clone(self.get_url('target'))