/breezy/trunk

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/trunk

« back to all changes in this revision

Viewing changes to breezy/git/commit.py

Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
214
214
        encoding = self._revprops.pop(u'git-explicit-encoding', 'utf-8')
215
215
        c.encoding = encoding.encode('ascii')
216
216
        c.committer = fix_person_identifier(self._committer.encode(encoding))
217
 
        c.author = fix_person_identifier(self._revprops.pop(
218
 
            'author', self._committer).encode(encoding))
 
217
        try:
 
218
            author = self._revprops.pop('author')
 
219
        except KeyError:
 
220
            try:
 
221
                authors = self._revprops.pop('authors').splitlines()
 
222
            except KeyError:
 
223
                author = self._committer
 
224
            else:
 
225
                if len(authors) > 1:
 
226
                    raise Exception("Unable to convert multiple authors")
 
227
                elif len(authors) == 0:
 
228
                    author = self._committer
 
229
                else:
 
230
                    author = authors[0]
 
231
        c.author = fix_person_identifier(author.encode(encoding))
219
232
        if self._revprops:
220
233
            raise NotImplementedError(self._revprops)
221
234
        c.commit_time = int(self._timestamp)