~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_branch/test_hooks.py

Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
    revision,
24
24
    tests,
25
25
    )
 
26
from bzrlib.symbol_versioning import deprecated_in
26
27
from bzrlib.tests import test_server
27
28
 
28
29
class ChangeBranchTipTestCase(tests.TestCaseWithMemoryTransport):
87
88
        branch = self.make_branch('source')
88
89
        _mod_branch.Branch.hooks.install_named_hook(
89
90
            'set_rh', self.capture_set_rh_hook, None)
90
 
        branch.set_revision_history([])
 
91
        self.applyDeprecated(deprecated_in((2, 4, 0)),
 
92
            branch.set_revision_history, [])
91
93
        expected_params = ('set_rh', branch, [], True)
92
94
        self.assertHookCalls(expected_params, branch)
93
95
 
103
105
            'set_rh', self.capture_set_rh_hook, None)
104
106
        # some branches require that their history be set to a revision in the
105
107
        # repository
106
 
        branch.set_revision_history(['f\xc2\xb5'])
 
108
        self.applyDeprecated(deprecated_in((2, 4, 0)),
 
109
            branch.set_revision_history, ['f\xc2\xb5'])
107
110
        expected_params =('set_rh', branch, ['f\xc2\xb5'], True)
108
111
        self.assertHookCalls(expected_params, branch)
109
112
 
111
114
        branch = self.make_branch('source')
112
115
        _mod_branch.Branch.hooks.install_named_hook(
113
116
            'set_rh', self.capture_set_rh_hook, None)
114
 
        branch.set_revision_history([])
 
117
        self.applyDeprecated(deprecated_in((2, 4, 0)),
 
118
            branch.set_revision_history, [])
115
119
        expected_params = ('set_rh', branch, [], True)
116
120
        self.assertHookCalls(expected_params, branch)
117
121
 
121
125
            'set_rh', self.capture_set_rh_hook, None)
122
126
        _mod_branch.Branch.hooks.install_named_hook(
123
127
            'set_rh', self.capture_set_rh_hook, None)
124
 
        branch.set_revision_history([])
 
128
        self.applyDeprecated(deprecated_in((2, 4, 0)),
 
129
            branch.set_revision_history, [])
125
130
        expected_calls = [('set_rh', branch, [], True),
126
131
            ('set_rh', branch, [], True),
127
132
            ]
386
391
 
387
392
    def test_set_revision_history(self):
388
393
        branch = self.make_branch('')
389
 
        branch.set_revision_history([])
 
394
        self.applyDeprecated(deprecated_in((2, 4, 0)),
 
395
            branch.set_revision_history, [])
390
396
        self.assertPreAndPostHooksWereInvoked(branch, True)
391
397
 
392
398
    def test_set_last_revision_info(self):