~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transform.py

  • Committer: Vincent Ladeuil
  • Date: 2011-07-07 10:19:00 UTC
  • mfrom: (6011.2.1 trunk)
  • mto: (6012.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 6013.
  • Revision ID: v.ladeuil+lp@free.fr-20110707101900-b0mxc2cnwu2dql97
Merging in trunk with root-id preserved

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