~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/revisionspec.py

  • Committer: Martin Pool
  • Date: 2008-06-11 02:36:40 UTC
  • mfrom: (3490 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3492.
  • Revision ID: mbp@sourcefrog.net-20080611023640-db0lqd75yueksdw7
Merge news

Show diffs side-by-side

added added

removed removed

Lines of Context:
135
135
    """
136
136
 
137
137
    prefix = None
 
138
    wants_revision_history = True
138
139
 
139
140
    def __new__(cls, spec, _internal=False):
140
141
        if _internal:
160
161
 
161
162
        if spec is None:
162
163
            return RevisionSpec(None, _internal=True)
163
 
 
164
 
        assert isinstance(spec, basestring), \
165
 
            "You should only supply strings not %s" % (type(spec),)
166
 
 
167
164
        for spectype in SPEC_TYPES:
168
165
            if spec.startswith(spectype.prefix):
169
166
                trace.mutter('Returning RevisionSpec %s for %s',
219
216
 
220
217
    def in_history(self, branch):
221
218
        if branch:
222
 
            revs = branch.revision_history()
 
219
            if self.wants_revision_history:
 
220
                revs = branch.revision_history()
 
221
            else:
 
222
                revs = None
223
223
        else:
224
224
            # this should never trigger.
225
225
            # TODO: make it a deprecated code path. RBC 20060928
296
296
                                   your history is very long.
297
297
    """
298
298
    prefix = 'revno:'
 
299
    wants_revision_history = False
299
300
 
300
301
    def _match_on(self, branch, revs):
301
302
        """Lookup a revision by revision number"""