/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/per_workingtree/test_commit.py

  • Committer: Ian Clatworthy
  • Date: 2009-09-07 23:14:05 UTC
  • mto: (4634.34.1 integration-2.0)
  • mto: This revision was merged to the branch mainline in revision 4680.
  • Revision ID: ian.clatworthy@canonical.com-20090907231405-5x93io3ghextl7ue
review feedback from Robert: rename finish_commit to post_commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
612
612
        committed_tree = tree.basis_tree()
613
613
        self.assertTrue(committed_tree.has_filename("newfile"))
614
614
 
615
 
    def test_finish_commit_hook(self):
616
 
        """Make sure a finish commit hook is called after a commit."""
617
 
        def finish_commit_hook_test_params(params):
 
615
    def test_post_commit_hook(self):
 
616
        """Make sure a post_commit hook is called after a commit."""
 
617
        def post_commit_hook_test_params(params):
618
618
            self.assertTrue(isinstance(params,
619
 
                mutabletree.FinishCommitHookParams))
 
619
                mutabletree.PostCommitHookParams))
620
620
            self.assertTrue(isinstance(params.mutable_tree,
621
621
                mutabletree.MutableTree))
622
622
            open(tree.abspath("newfile"), 'w').write("data")
623
623
            params.mutable_tree.add(["newfile"])
624
624
        def restoreDefaults():
625
 
            mutabletree.MutableTree.hooks['finish_commit'] = []
 
625
            mutabletree.MutableTree.hooks['post_commit'] = []
626
626
        self.addCleanup(restoreDefaults)
627
627
        tree = self.make_branch_and_tree('.')
628
628
        mutabletree.MutableTree.hooks.install_named_hook(
629
 
            'finish_commit',
630
 
            finish_commit_hook_test_params,
 
629
            'post_commit',
 
630
            post_commit_hook_test_params,
631
631
            None)
632
632
        self.assertFalse(tree.has_filename("newfile"))
633
633
        revid = tree.commit('first post')