~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transform.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-06-28 15:58:20 UTC
  • mfrom: (5993.2.4 merge-inner-rootless)
  • Revision ID: pqm@pqm.ubuntu.com-20110628155820-g1hpzbqc5573rts5
(jelmer) Re-introduce root when merge result is empty tree. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
291
291
        transform.fixup_new_roots()
292
292
        self.assertNotIn(transform.root, transform._new_id)
293
293
 
 
294
    def test_remove_root_fixup(self):
 
295
        transform, root = self.get_transform()
 
296
        old_root_id = self.wt.get_root_id()
 
297
        self.assertNotEqual('new-root-id', old_root_id)
 
298
        transform.delete_contents(root)
 
299
        transform.unversion_file(root)
 
300
        transform.fixup_new_roots()
 
301
        transform.apply()
 
302
        self.assertEqual(old_root_id, self.wt.get_root_id())
 
303
 
 
304
        transform, root = self.get_transform()
 
305
        new_trans_id = transform.new_directory('', ROOT_PARENT, 'new-root-id')
 
306
        new_trans_id = transform.new_directory('', ROOT_PARENT, 'alt-root-id')
 
307
        self.assertRaises(ValueError, transform.fixup_new_roots)
 
308
 
294
309
    def test_apply_retains_root_directory(self):
295
310
        # Do not attempt to delete the physical root directory, because that
296
311
        # is impossible.