3717
3718
remaining_conflicts.pop())
3718
3719
self.assertLength(1, warnings)
3719
3720
self.assertStartsWith(warnings[0], 'donttouchmypreciouuus')
3723
class TestTransformHooks(tests.TestCaseWithTransport):
3726
super(TestTransformHooks, self).setUp()
3727
self.wt = self.make_branch_and_tree('.')
3730
def get_transform(self):
3731
transform = TreeTransform(self.wt)
3732
self.addCleanup(transform.finalize)
3733
return transform, transform.root
3735
def test_pre_commit_hooks(self):
3737
def record_pre_transform(tree, tt):
3738
calls.append((tree, tt))
3739
MutableTree.hooks.install_named_hook('pre_transform',
3740
record_pre_transform, "Pre transform")
3741
transform, root = self.get_transform()
3742
old_root_id = transform.tree_file_id(root)
3744
self.assertEqual(old_root_id, self.wt.get_root_id())
3745
self.assertEquals([(self.wt, transform)], calls)
3747
def test_post_commit_hooks(self):
3749
def record_post_transform(tree, tt):
3750
calls.append((tree, tt))
3751
MutableTree.hooks.install_named_hook('post_transform',
3752
record_post_transform, "Post transform")
3753
transform, root = self.get_transform()
3754
old_root_id = transform.tree_file_id(root)
3756
self.assertEqual(old_root_id, self.wt.get_root_id())
3757
self.assertEquals([(self.wt, transform)], calls)