/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-09 02:29:55 UTC
  • mto: This revision was merged to the branch mainline in revision 7149.
  • Revision ID: jelmer@jelmer.uk-20181109022955-3wmoo700xpxzyfch
Support the 'authors' revprop when creating Git commits.

Show diffs side-by-side

added added

removed removed

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