~jelmer/brz/fix-c-extensions

« back to all changes in this revision

Viewing changes to breezy/revisionspec.py

  • Committer: Jelmer Vernooij
  • Date: 2017-07-23 22:06:41 UTC
  • mfrom: (6738 trunk)
  • mto: This revision was merged to the branch mainline in revision 6739.
  • Revision ID: jelmer@jelmer.uk-20170723220641-69eczax9bmv8d6kk
Merge trunk, address review comments.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
    registry,
39
39
    trace,
40
40
    )
 
41
from .sixish import (
 
42
    text_type,
 
43
    )
41
44
 
42
45
 
43
46
class RevisionInfo(object):
154
157
        :return: A RevisionSpec object that understands how to parse the
155
158
            supplied notation.
156
159
        """
157
 
        if not isinstance(spec, (type(None), basestring)):
158
 
            raise TypeError('error')
159
 
 
160
160
        if spec is None:
161
161
            return RevisionSpec(None, _internal=True)
 
162
        if not isinstance(spec, (str, text_type)):
 
163
            raise TypeError("revision spec needs to be text")
162
164
        match = revspec_registry.get_prefix(spec)
163
165
        if match is not None:
164
166
            spectype, specsuffix = match