28
28
from bzrlib.transform import (TreeTransform, ROOT_PARENT, FinalPaths,
29
29
resolve_conflicts, cook_conflicts,
30
30
find_interesting, build_tree, get_backup_name)
31
import bzrlib.urlutils as urlutils
32
33
class TestTreeTransform(TestCaseInTempDir):
34
36
super(TestTreeTransform, self).setUp()
35
37
self.wt = BzrDir.create_standalone_workingtree('.')
41
43
return transform, transform.trans_id_tree_file_id(self.wt.get_root_id())
43
45
def test_existing_limbo(self):
44
limbo_name = self.wt._control_files.controlfilename('limbo')
46
limbo_name = urlutils.local_path_from_url(
47
self.wt._control_files.controlfilename('limbo'))
45
48
transform, root = self.get_transform()
46
49
os.mkdir(pathjoin(limbo_name, 'hehe'))
47
50
self.assertRaises(ImmortalLimbo, transform.apply)
492
495
self.assertRaises(NotVersionedError, find_interesting, wt, wt,
498
def test_set_executability_order(self):
499
"""Ensure that executability behaves the same, no matter what order.
501
- create file and set executability simultaneously
502
- create file and set executability afterward
503
- unsetting the executability of a file whose executability has not been
504
declared should throw an exception (this may happen when a
505
merge attempts to create a file with a duplicate ID)
507
transform, root = self.get_transform()
509
transform.new_file('set_on_creation', root, 'Set on creation', 'soc',
511
sac = transform.new_file('set_after_creation', root, 'Set after creation', 'sac')
512
transform.set_executability(True, sac)
513
uws = transform.new_file('unset_without_set', root, 'Unset badly', 'uws')
514
self.assertRaises(KeyError, transform.set_executability, None, uws)
516
self.assertTrue(wt.is_executable('soc'))
517
self.assertTrue(wt.is_executable('sac'))
496
520
class TransformGroup(object):
497
521
def __init__(self, dirname):