90
90
spec.as_revision_id(self.tree.branch))
93
class RevisionSpecMatchOnTrap(RevisionSpec):
95
def _match_on(self, branch, revs):
96
self.last_call = (branch, revs)
97
return super(RevisionSpecMatchOnTrap, self)._match_on(branch, revs)
100
class TestRevisionSpecBase(TestRevisionSpec):
102
def test_wants_revision_history(self):
103
# If wants_revision_history = True, then _match_on should get the
104
# branch revision history
105
spec = RevisionSpecMatchOnTrap('foo', _internal=True)
106
spec.in_history(self.tree.branch)
108
self.assertEqual((self.tree.branch, ['r1' ,'r2']),
111
def test_wants_no_revision_history(self):
112
# If wants_revision_history = False, then _match_on should get None for
113
# the branch revision history
114
spec = RevisionSpecMatchOnTrap('foo', _internal=True)
115
spec.wants_revision_history = False
116
spec.in_history(self.tree.branch)
118
self.assertEqual((self.tree.branch, None), spec.last_call)
93
122
class TestOddRevisionSpec(TestRevisionSpec):
94
123
"""Test things that aren't normally thought of as revision specs"""