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

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-06-11 16:46:46 UTC
  • mfrom: (7512.1.1 drop-travis-appveyor)
  • Revision ID: breezy.the.bot@gmail.com-20200611164646-w4tufva3jchfv1mn
Drop appveyor + travis configuration.

Merged from https://code.launchpad.net/~jelmer/brz/drop-travis-appveyor/+merge/385578

Show diffs side-by-side

added added

removed removed

Lines of Context:
114
114
    if b"<" not in text and b">" not in text:
115
115
        username = text
116
116
        email = text
 
117
    elif b">" not in text:
 
118
        return text + b">"
117
119
    else:
118
120
        if text.rindex(b">") < text.rindex(b"<"):
119
121
            raise ValueError(text)
324
326
            commit.author_timezone = commit.commit_timezone
325
327
        if u'git-gpg-signature' in rev.properties:
326
328
            commit.gpgsig = rev.properties[u'git-gpg-signature'].encode(
327
 
                'ascii')
 
329
                'utf-8')
 
330
        if u'git-gpg-signature-b64' in rev.properties:
 
331
            commit.gpgsig = base64.b64decode(rev.properties[u'git-gpg-signature-b64'])
328
332
        commit.message = self._encode_commit_message(rev, rev.message,
329
333
                                                     encoding)
330
334
        if not isinstance(commit.message, bytes):
337
341
            mapping_properties = set(
338
342
                [u'author', u'author-timezone', u'author-timezone-neg-utc',
339
343
                 u'commit-timezone-neg-utc', u'git-implicit-encoding',
340
 
                 u'git-gpg-signature', u'git-explicit-encoding',
 
344
                 u'git-gpg-signature', u'git-gpg-signature-b64',
 
345
                 u'git-explicit-encoding',
341
346
                 u'author-timestamp', u'file-modes'])
342
347
            for k, v in rev.properties.items():
343
348
                if k not in mapping_properties:
419
424
        if commit._commit_timezone_neg_utc:
420
425
            rev.properties[u'commit-timezone-neg-utc'] = ""
421
426
        if commit.gpgsig:
422
 
            rev.properties[u'git-gpg-signature'] = commit.gpgsig.decode(
423
 
                'ascii')
 
427
            try:
 
428
                rev.properties[u'git-gpg-signature'] = commit.gpgsig.decode(
 
429
                    'utf-8')
 
430
            except UnicodeDecodeError:
 
431
                rev.properties[u'git-gpg-signature-b64'] = base64.b64encode(
 
432
                    commit.gpgsig)
424
433
        if commit.mergetag:
425
434
            for i, tag in enumerate(commit.mergetag):
426
435
                rev.properties[u'git-mergetag-%d' % i] = tag.as_raw_string()