~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: John Arbash Meinel
  • Date: 2011-05-11 11:35:28 UTC
  • mto: This revision was merged to the branch mainline in revision 5851.
  • Revision ID: john@arbash-meinel.com-20110511113528-qepibuwxicjrbb2h
Break compatibility with python <2.6.

This includes auditing the code for places where we were doing
explicit 'sys.version' checks and removing them as appropriate.

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