~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_revisionspec.py

  • Committer: Jelmer Vernooij
  • Date: 2012-02-20 12:19:29 UTC
  • mfrom: (6437.23.11 2.5)
  • mto: (6581.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 6582.
  • Revision ID: jelmer@samba.org-20120220121929-7ni2psvjoatm1yp4
Merge bzr/2.5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
from bzrlib import (
21
21
    errors,
22
22
    revision as _mod_revision,
 
23
    symbol_versioning,
23
24
    )
24
25
from bzrlib.tests import TestCaseWithTransport
25
26
from bzrlib.revisionspec import (
118
119
        # If wants_revision_history = True, then _match_on should get the
119
120
        # branch revision history
120
121
        spec = RevisionSpecMatchOnTrap('foo', _internal=True)
121
 
        spec.in_history(self.tree.branch)
 
122
        spec.wants_revision_history = True
 
123
        self.callDeprecated(['RevisionSpec.wants_revision_history was '
 
124
            'deprecated in 2.5 (RevisionSpecMatchOnTrap).'],
 
125
            spec.in_history, self.tree.branch)
122
126
 
123
127
        self.assertEqual((self.tree.branch, ['r1' ,'r2']),
124
128
                         spec.last_call)
127
131
        # If wants_revision_history = False, then _match_on should get None for
128
132
        # the branch revision history
129
133
        spec = RevisionSpecMatchOnTrap('foo', _internal=True)
130
 
        spec.wants_revision_history = False
131
134
        spec.in_history(self.tree.branch)
132
135
 
133
136
        self.assertEqual((self.tree.branch, None), spec.last_call)
150
153
 
151
154
    def _match_on(self, branch, revs):
152
155
        if self.spec == "bork":
153
 
            return RevisionInfo.from_revision_id(branch, "r1", revs)
 
156
            return RevisionInfo.from_revision_id(branch, "r1")
154
157
        else:
155
158
            raise errors.InvalidRevisionSpec(self.spec, branch)
156
159