/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-31 17:22:38 UTC
  • mto: This revision was merged to the branch mainline in revision 3609.
  • Revision ID: jw+debian@jameswestby.net-20080731172238-ba5br3gjk2mjkarb
Handle ->symlink changes as well.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1230
1230
        tt.version_file("bar-1", bar_trans_id)
1231
1231
        tt.apply()
1232
1232
        self.failUnlessExists("foo/bar")
 
1233
        wt.lock_read()
 
1234
        try:
 
1235
            self.assertEqual(wt.inventory.get_file_kind(wt.path2id("foo")),
 
1236
                    "directory")
 
1237
        finally:
 
1238
            wt.unlock()
1233
1239
        wt.commit("two")
1234
1240
        changes = wt.changes_from(wt.basis_tree())
1235
1241
        self.assertFalse(changes.has_changed(), changes)
1236
1242
 
 
1243
    def test_file_to_symlink(self):
 
1244
        wt = self.make_branch_and_tree('.')
 
1245
        self.build_tree(['foo'])
 
1246
        wt.add(['foo'])
 
1247
        wt.commit("one")
 
1248
        tt = TreeTransform(wt)
 
1249
        self.addCleanup(tt.finalize)
 
1250
        foo_trans_id = tt.trans_id_tree_path("foo")
 
1251
        tt.delete_contents(foo_trans_id)
 
1252
        tt.create_symlink("bar", foo_trans_id)
 
1253
        tt.apply()
 
1254
        self.failUnlessExists("foo")
 
1255
        wt.lock_read()
 
1256
        self.addCleanup(wt.unlock)
 
1257
        self.assertEqual(wt.inventory.get_file_kind(wt.path2id("foo")),
 
1258
                "symlink")
 
1259
 
1237
1260
 
1238
1261
class TransformGroup(object):
1239
1262