~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

(gz) Fix test failure on alpha by correcting format string for
 gc_chk_sha1_record (Martin [gz])

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
    errors,
22
22
    revision as _mod_revision,
23
23
    )
24
 
from bzrlib.symbol_versioning import deprecated_in
25
24
from bzrlib.tests import per_branch
26
25
 
27
26
 
113
112
        # Lock the branch, set the revision history, then repeatedly call
114
113
        # revision_history.
115
114
        branch.lock_write()
116
 
        self.applyDeprecated(deprecated_in((2, 4, 0)),
117
 
            branch.set_revision_history, [])
 
115
        branch.set_revision_history([])
118
116
        try:
119
117
            branch.revision_history()
120
118
            self.assertEqual([], calls)
126
124
        cause the revision history to be cached.
127
125
        """
128
126
        branch, calls = self.get_instrumented_branch()
129
 
        self.applyDeprecated(deprecated_in((2, 4, 0)),
130
 
            branch.set_revision_history, [])
 
127
        branch.set_revision_history([])
131
128
        branch.revision_history()
132
129
        self.assertEqual(['_gen_revision_history'], calls)
133
130
 
150
147
            a_branch.unlock()
151
148
 
152
149
    def test_set_last_revision_info_none(self):
153
 
        """Passing None to set_last_revision_info raises an exception."""
 
150
        """Passing None to revision_info to None sets it to NULL_REVISION."""
154
151
        a_branch = self.get_branch()
155
152
        # Lock the branch, set the last revision info, then call
156
153
        # last_revision_info.
157
154
        a_branch.lock_write()
158
155
        self.addCleanup(a_branch.unlock)
159
 
        self.assertRaises(errors.InvalidRevisionId,
 
156
        self.callDeprecated(['NULL_REVISION should be used for the null'
 
157
            ' revision instead of None, as of bzr 0.91.'],
160
158
            a_branch.set_last_revision_info, 0, None)
 
159
        self.assertEqual((0, _mod_revision.NULL_REVISION),
 
160
                         a_branch.last_revision_info())
161
161
 
162
162
    def test_set_last_revision_info_uncaches_revision_history_for_format6(self):
163
163
        """On format 6 branches, set_last_revision_info invalidates the revision