/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transform.py

  • Committer: James Westby
  • Date: 2008-07-17 15:56:09 UTC
  • mto: (3566.1.1 bzr.ab.integration)
  • mto: This revision was merged to the branch mainline in revision 3567.
  • Revision ID: jw+debian@jameswestby.net-20080717155609-bvwrtxv3uhnlqvs6
Fixes from review. Thanks Aaron and John.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1217
1217
 
1218
1218
    def test_file_to_directory(self):
1219
1219
        wt = self.make_branch_and_tree('.')
1220
 
        f = open('foo', 'wb')
1221
 
        try:
1222
 
            f.write("contents\n")
1223
 
        finally:
1224
 
            f.close()
 
1220
        self.build_tree(['foo'])
1225
1221
        wt.add(['foo'])
1226
 
        wt.commit("one")
1227
1222
        tt = TreeTransform(wt)
1228
 
        try:
1229
 
            old_trans_id = tt.trans_id_tree_path("foo")
1230
 
            tt.delete_contents(old_trans_id)
1231
 
            tt.new_directory('foo', tt.root)
1232
 
            new_trans_id = tt.trans_id_tree_path("foo/bar")
1233
 
            tt.create_file(["new\n", "content\n"], new_trans_id)
1234
 
            tt.apply(no_conflicts=True)
1235
 
        except:
1236
 
            tt.finalize()
1237
 
            raise
 
1223
        self.addCleanup(tt.finalize)
 
1224
        old_trans_id = tt.trans_id_tree_path("foo")
 
1225
        tt.delete_contents(old_trans_id)
 
1226
        tt.new_directory('foo', tt.root)
 
1227
        new_trans_id = tt.trans_id_tree_path("foo/bar")
 
1228
        tt.create_file(["new\n", "content\n"], new_trans_id)
 
1229
        tt.apply()
1238
1230
        self.failUnlessExists("foo/bar")
1239
1231
 
1240
1232