/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 breezy/revision.py

  • Committer: Breezy landing bot
  • Author(s): Martin
  • Date: 2017-06-11 01:56:34 UTC
  • mfrom: (6684.1.5 py3_bootstrap2)
  • Revision ID: breezy.the.bot@gmail.com-20170611015634-9eeh86thh073hcko
More progress towards Python 3 support

Merged from https://code.launchpad.net/~gz/brz/py3_bootstrap2/+merge/325452

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
""")
27
27
from . import (
28
28
    errors,
29
 
    )
30
 
from .osutils import contains_whitespace
 
29
    osutils,
 
30
    )
 
31
from .sixish import (
 
32
    text_type,
 
33
    )
31
34
 
32
35
NULL_REVISION=b"null:"
33
36
CURRENT_REVISION=b"current:"
86
89
    def _check_properties(self):
87
90
        """Verify that all revision properties are OK."""
88
91
        for name, value in self.properties.items():
89
 
            if not isinstance(name, basestring) or contains_whitespace(name):
 
92
            # GZ 2017-06-10: What sort of string are properties exactly?
 
93
            not_text = not isinstance(name, (text_type, str))
 
94
            if not_text or osutils.contains_whitespace(name):
90
95
                raise ValueError("invalid property name %r" % name)
91
 
            if not isinstance(value, basestring):
 
96
            if not isinstance(value, (text_type, bytes)):
92
97
                raise ValueError("invalid property value %r for %r" %
93
98
                                 (value, name))
94
99
 
205
210
 
206
211
    :return: True if the revision is reserved, False otherwise
207
212
    """
208
 
    return isinstance(revision_id, basestring) and revision_id.endswith(':')
 
213
    return isinstance(revision_id, bytes) and revision_id.endswith(b':')
209
214
 
210
215
 
211
216
def check_not_reserved_id(revision_id):