~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_revisionspec.py

  • Committer: Patch Queue Manager
  • Date: 2015-12-17 18:39:00 UTC
  • mfrom: (6606.1.2 fix-float)
  • Revision ID: pqm@pqm.ubuntu.com-20151217183900-0719du2uv1kwu3lc
(vila) Inline testtools private method to fix an issue in xenial (the
 private implementation has changed in an backward incompatible way).
 (Jelmer Vernooij)

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
 
697
700
class TestRevisionSpec_annotate(TestRevisionSpec):
698
701
 
699
702
    def setUp(self):
700
 
        TestRevisionSpec.setUp(self)
 
703
        super(TestRevisionSpec_annotate, self).setUp()
701
704
        self.tree = self.make_branch_and_tree('annotate-tree')
702
705
        self.build_tree_contents([('annotate-tree/file1', '1\n')])
703
706
        self.tree.add('file1')