remote-bzr: set author if available

[fc: added tests]

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
David Engster
2013-04-05 21:49:19 -06:00
committed by Junio C Hamano
parent bc51f7c3e2
commit 9d9d698c43
2 changed files with 21 additions and 1 deletions

View File

@ -266,7 +266,12 @@ def export_branch(branch, name):
tz = rev.timezone
committer = rev.committer.encode('utf-8')
committer = "%s %u %s" % (fixup_user(committer), time, gittz(tz))
author = committer
authors = rev.get_apparent_authors()
if authors:
author = authors[0].encode('utf-8')
author = "%s %u %s" % (fixup_user(author), time, gittz(tz))
else:
author = committer
msg = rev.message.encode('utf-8')
msg += '\n'