~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transform.py

Show diffs side-by-side

added added

removed removed

Lines of Context:
285
285
        new_trans_id = transform.new_directory('', ROOT_PARENT, 'alt-root-id')
286
286
        self.assertRaises(ValueError, transform.fixup_new_roots)
287
287
 
 
288
    def test_retain_existing_root(self):
 
289
        tt, root = self.get_transform()
 
290
        with tt:
 
291
            tt.new_directory('', ROOT_PARENT, 'new-root-id')
 
292
            tt.fixup_new_roots()
 
293
            self.assertNotEqual('new-root-id', tt.final_file_id(tt.root))
 
294
 
 
295
    def test_retain_existing_root_added_file(self):
 
296
        tt, root = self.get_transform()
 
297
        new_trans_id = tt.new_directory('', ROOT_PARENT, 'new-root-id')
 
298
        child = tt.new_directory('child', new_trans_id, 'child-id')
 
299
        tt.fixup_new_roots()
 
300
        self.assertEqual(tt.root, tt.final_parent(child))
 
301
 
288
302
    def test_add_unversioned_root(self):
289
303
        transform, root = self.get_transform()
290
304
        new_trans_id = transform.new_directory('', ROOT_PARENT, None)
 
305
        transform.delete_contents(transform.root)
291
306
        transform.fixup_new_roots()
292
307
        self.assertNotIn(transform.root, transform._new_id)
293
308