/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: Jelmer Vernooij
  • Date: 2020-06-15 01:29:36 UTC
  • mfrom: (7490.40.4 work)
  • mto: (7490.40.19 work)
  • mto: This revision was merged to the branch mainline in revision 7516.
  • Revision ID: jelmer@jelmer.uk-20200615012936-1adqbu592y7lzmy8
Merge upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
121
121
    if b"<" not in text and b">" not in text:
122
122
        username = text
123
123
        email = text
 
124
    elif b">" not in text:
 
125
        return text + b">"
124
126
    else:
125
127
        if text.rindex(b">") < text.rindex(b"<"):
126
128
            raise ValueError(text)
332
334
            commit.author_timezone = commit.commit_timezone
333
335
        if u'git-gpg-signature' in rev.properties:
334
336
            commit.gpgsig = rev.properties[u'git-gpg-signature'].encode(
335
 
                'ascii')
 
337
                'utf-8')
 
338
        if u'git-gpg-signature-b64' in rev.properties:
 
339
            commit.gpgsig = base64.b64decode(rev.properties[u'git-gpg-signature-b64'])
336
340
        commit.message = self._encode_commit_message(rev, rev.message,
337
341
                                                     encoding)
338
342
        if not isinstance(commit.message, bytes):
345
349
            mapping_properties = set(
346
350
                [u'author', u'author-timezone', u'author-timezone-neg-utc',
347
351
                 u'commit-timezone-neg-utc', u'git-implicit-encoding',
348
 
                 u'git-gpg-signature', u'git-explicit-encoding',
 
352
                 u'git-gpg-signature', u'git-gpg-signature-b64',
 
353
                 u'git-explicit-encoding',
349
354
                 u'author-timestamp', u'file-modes'])
350
355
            for k, v in viewitems(rev.properties):
351
356
                if k not in mapping_properties:
427
432
        if commit._commit_timezone_neg_utc:
428
433
            rev.properties[u'commit-timezone-neg-utc'] = ""
429
434
        if commit.gpgsig:
430
 
            rev.properties[u'git-gpg-signature'] = commit.gpgsig.decode(
431
 
                'ascii')
 
435
            try:
 
436
                rev.properties[u'git-gpg-signature'] = commit.gpgsig.decode(
 
437
                    'utf-8')
 
438
            except UnicodeDecodeError:
 
439
                rev.properties[u'git-gpg-signature-b64'] = base64.b64encode(
 
440
                    commit.gpgsig)
432
441
        if commit.mergetag:
433
442
            for i, tag in enumerate(commit.mergetag):
434
443
                rev.properties[u'git-mergetag-%d' % i] = tag.as_raw_string()