~ubuntu-branches/ubuntu/karmic/bzr/karmic-proposed

« back to all changes in this revision

Viewing changes to bzrlib/tests/workingtree_implementations/test_commit.py

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2008-05-12 00:14:54 UTC
  • mfrom: (1.1.42 upstream)
  • Revision ID: james.westby@ubuntu.com-20080512001454-yjpajuiocykl48p9
Tags: 1.5~rc1-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
498
498
        ui.ui_factory = factory
499
499
        def a_hook(_, _2, _3, _4, _5, _6):
500
500
            pass
501
 
        branch.Branch.hooks.install_hook('post_commit', a_hook)
502
 
        branch.Branch.hooks.name_hook(a_hook, 'hook name')
 
501
        branch.Branch.hooks.install_named_hook('post_commit', a_hook,
 
502
                                               'hook name')
503
503
        tree.commit('first post')
504
504
        self.assertEqual(
505
505
            [('update', 1, 5, 'Collecting changes [Directory 0] - Stage'),
523
523
        ui.ui_factory = factory
524
524
        def a_hook(_, _2, _3, _4, _5, _6, _7, _8):
525
525
            pass
526
 
        branch.Branch.hooks.install_hook('pre_commit', a_hook)
527
 
        branch.Branch.hooks.name_hook(a_hook, 'hook name')
 
526
        branch.Branch.hooks.install_named_hook('pre_commit', a_hook,
 
527
                                               'hook name')
528
528
        tree.commit('first post')
529
529
        self.assertEqual(
530
530
            [('update', 1, 5, 'Collecting changes [Directory 0] - Stage'),
548
548
            mutabletree.MutableTree.hooks['start_commit'] = []
549
549
        self.addCleanup(restoreDefaults)
550
550
        tree = self.make_branch_and_tree('.')
551
 
        mutabletree.MutableTree.hooks.install_hook('start_commit', 
552
 
            start_commit_hook_adds_file)
 
551
        mutabletree.MutableTree.hooks.install_named_hook(
 
552
            'start_commit',
 
553
            start_commit_hook_adds_file,
 
554
            None)
553
555
        revid = tree.commit('first post')
554
556
        committed_tree = tree.basis_tree()
555
557
        self.assertTrue(committed_tree.has_filename("newfile"))