/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_revisionspec.py

Update to bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
90
90
                         spec.as_revision_id(self.tree.branch))
91
91
 
92
92
 
 
93
class RevisionSpecMatchOnTrap(RevisionSpec):
 
94
 
 
95
    def _match_on(self, branch, revs):
 
96
        self.last_call = (branch, revs)
 
97
        return super(RevisionSpecMatchOnTrap, self)._match_on(branch, revs)
 
98
 
 
99
 
 
100
class TestRevisionSpecBase(TestRevisionSpec):
 
101
 
 
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)
 
107
 
 
108
        self.assertEqual((self.tree.branch, ['r1' ,'r2']),
 
109
                         spec.last_call)
 
110
 
 
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)
 
117
 
 
118
        self.assertEqual((self.tree.branch, None), spec.last_call)
 
119
 
 
120
 
 
121
 
93
122
class TestOddRevisionSpec(TestRevisionSpec):
94
123
    """Test things that aren't normally thought of as revision specs"""
95
124