/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/commit.py

  • Committer: Jelmer Vernooij
  • Date: 2018-11-16 10:50:21 UTC
  • mfrom: (7164 work)
  • mto: This revision was merged to the branch mainline in revision 7165.
  • Revision ID: jelmer@jelmer.uk-20181116105021-xl419v2rh4aus1au
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
205
205
        encoding = self._revprops.pop(u'git-explicit-encoding', 'utf-8')
206
206
        c.encoding = encoding.encode('ascii')
207
207
        c.committer = fix_person_identifier(self._committer.encode(encoding))
208
 
        c.author = fix_person_identifier(self._revprops.pop('author', self._committer).encode(encoding))
 
208
        try:
 
209
            author = self._revprops.pop('author')
 
210
        except KeyError:
 
211
            try:
 
212
                authors = self._revprops.pop('authors').splitlines()
 
213
            except KeyError:
 
214
                author = self._committer
 
215
            else:
 
216
                if len(authors) > 1:
 
217
                    raise Exception("Unable to convert multiple authors")
 
218
                elif len(authors) == 0:
 
219
                    author = self._committer
 
220
                else:
 
221
                    author = authors[0]
 
222
        c.author = fix_person_identifier(author.encode(encoding))
209
223
        if self._revprops:
210
224
            raise NotImplementedError(self._revprops)
211
225
        c.commit_time = int(self._timestamp)