/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: Jelmer Vernooij
  • Date: 2018-06-29 20:24:31 UTC
  • mfrom: (6999 work)
  • mto: This revision was merged to the branch mainline in revision 7008.
  • Revision ID: jelmer@jelmer.uk-20180629202431-2td8kihrsthzuvau
merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
from ...revision import (
41
41
    NULL_REVISION,
42
42
    )
 
43
from ...sixish import text_type
43
44
from .errors import (
44
45
    NoPushSupport,
45
46
    UnknownCommitExtra,
159
160
        # We must just hope they are valid UTF-8..
160
161
        if path == "":
161
162
            return ROOT_ID
162
 
        if type(path) is unicode:
 
163
        if isinstance(path, text_type):
163
164
            path = path.encode("utf-8")
164
165
        return FILE_ID_PREFIX + escape_file_id(path)
165
166
 
336
337
                commit.message = inject_bzr_metadata(commit.message, metadata,
337
338
                                                     encoding)
338
339
            else:
339
 
                raise NoPushSupport()
 
340
                raise NoPushSupport(None, None, self, revision_id=rev.revision_id)
340
341
        if type(commit.message) is not str:
341
342
            raise TypeError(commit.message)
342
343
        i = 0
553
554
def symlink_to_blob(symlink_target):
554
555
    from dulwich.objects import Blob
555
556
    blob = Blob()
556
 
    if type(symlink_target) == unicode:
 
557
    if isinstance(symlink_target, text_type):
557
558
        symlink_target = symlink_target.encode('utf-8')
558
559
    blob.data = symlink_target
559
560
    return blob