/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/plugins/git/mapping.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-07-25 18:15:53 UTC
  • mfrom: (7045.4.7 python3-s)
  • Revision ID: breezy.the.bot@gmail.com-20180725181553-mz6zhncntlovb8ii
Fix another couple of hundred tests on Python 3.

Merged from https://code.launchpad.net/~jelmer/brz/python3-s/+merge/350749

Show diffs side-by-side

added added

removed removed

Lines of Context:
159
159
    def generate_file_id(self, path):
160
160
        # Git paths are just bytestrings
161
161
        # We must just hope they are valid UTF-8..
162
 
        if path == "":
163
 
            return ROOT_ID
164
162
        if isinstance(path, text_type):
165
163
            path = path.encode("utf-8")
 
164
        if path == b"":
 
165
            return ROOT_ID
166
166
        return FILE_ID_PREFIX + escape_file_id(path)
167
167
 
168
168
    def parse_file_id(self, file_id):
169
169
        if file_id == ROOT_ID:
170
 
            return ""
 
170
            return u""
171
171
        if not file_id.startswith(FILE_ID_PREFIX):
172
172
            raise ValueError
173
 
        return unescape_file_id(file_id[len(FILE_ID_PREFIX):])
 
173
        return unescape_file_id(file_id[len(FILE_ID_PREFIX):]).decode('utf-8')
174
174
 
175
175
    def revid_as_refname(self, revid):
176
176
        if not isinstance(revid, bytes):