/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: Canonical.com Patch Queue Manager
  • Date: 2011-07-14 13:52:21 UTC
  • mfrom: (6024.1.3 unbreak-transform)
  • Revision ID: pqm@pqm.ubuntu.com-20110714135221-785gbmtlr9zmlifl
Small TreeTransform fixes (Aaron Bentley).

Show diffs side-by-side

added added

removed removed

Lines of Context:
321
321
        new_trans_id = transform.new_directory('', ROOT_PARENT, 'alt-root-id')
322
322
        self.assertRaises(ValueError, transform.fixup_new_roots)
323
323
 
 
324
    def test_fixup_new_roots_permits_empty_tree(self):
 
325
        transform, root = self.get_transform()
 
326
        transform.delete_contents(root)
 
327
        transform.unversion_file(root)
 
328
        transform.fixup_new_roots()
 
329
        self.assertIs(None, transform.final_kind(root))
 
330
        self.assertIs(None, transform.final_file_id(root))
 
331
 
324
332
    def test_apply_retains_root_directory(self):
325
333
        # Do not attempt to delete the physical root directory, because that
326
334
        # is impossible.
332
340
                                  transform.apply)
333
341
        self.assertContainsRe('TransformRenameFailed not raised', str(e))
334
342
 
 
343
    def test_apply_retains_file_id(self):
 
344
        transform, root = self.get_transform()
 
345
        old_root_id = transform.tree_file_id(root)
 
346
        transform.unversion_file(root)
 
347
        transform.apply()
 
348
        self.assertEqual(old_root_id, self.wt.get_root_id())
 
349
 
335
350
    def test_hardlink(self):
336
351
        self.requireFeature(HardlinkFeature)
337
352
        transform, root = self.get_transform()