3713
3714
remaining_conflicts.pop())
3714
3715
self.assertLength(1, warnings)
3715
3716
self.assertStartsWith(warnings[0], 'donttouchmypreciouuus')
3719
class TestTransformHooks(tests.TestCaseWithTransport):
3722
super(TestTransformHooks, self).setUp()
3723
self.wt = self.make_branch_and_tree('.')
3726
def get_transform(self):
3727
transform = TreeTransform(self.wt)
3728
self.addCleanup(transform.finalize)
3729
return transform, transform.root
3731
def test_pre_commit_hooks(self):
3733
def record_pre_transform(tree, tt):
3734
calls.append((tree, tt))
3735
MutableTree.hooks.install_named_hook('pre_transform',
3736
record_pre_transform, "Pre transform")
3737
transform, root = self.get_transform()
3738
old_root_id = transform.tree_file_id(root)
3740
self.assertEqual(old_root_id, self.wt.get_root_id())
3741
self.assertEquals([(self.wt, transform)], calls)
3743
def test_post_commit_hooks(self):
3745
def record_post_transform(tree, tt):
3746
calls.append((tree, tt))
3747
MutableTree.hooks.install_named_hook('post_transform',
3748
record_post_transform, "Post transform")
3749
transform, root = self.get_transform()
3750
old_root_id = transform.tree_file_id(root)
3752
self.assertEqual(old_root_id, self.wt.get_root_id())
3753
self.assertEquals([(self.wt, transform)], calls)