remote-bzr: include authors field in pushed commits

Tests-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

dequis committed Apr 9, 2014 at 13:50 UTC 62210887f783d942ddfa918b3974b42311d3ef9d
2 files changed +26
contrib/remote-helpers/git-remote-bzr
+2
@@ -618,10 +618,12 @@ def parse_commit(parser):
618 files[path] = f
619
620 committer, date, tz = committer
621 + author, _, _ = author
622 parents = [mark_to_rev(p) for p in parents]
623 revid = bzrlib.generate_ids.gen_revision_id(committer, date)
624 props = {}
625 props['branch-nick'] = branch.nick
626 + props['authors'] = author
627
628 mtree = CustomTree(branch, revid, parents, files)
629 changes = mtree.iter_changes()
contrib/remote-helpers/test-bzr.sh
+24
@@ -391,4 +391,28 @@ test_expect_success 'export utf-8 authors' '
391 test_cmp expected actual
392 '
393
394 +test_expect_success 'push different author' '
395 + test_when_finished "rm -rf bzrrepo gitrepo" &&
396 +
397 + bzr init bzrrepo &&
398 +
399 + (
400 + git init gitrepo &&
401 + cd gitrepo &&
402 + echo john >> content &&
403 + git add content &&
404 + git commit -m john --author "John Doe <jdoe@example.com>" &&
405 + git remote add bzr "bzr::../bzrrepo" &&
406 + git push bzr master
407 + ) &&
408 +
409 + (
410 + cd bzrrepo &&
411 + bzr log | grep "^author: " > ../actual
412 + ) &&
413 +
414 + echo "author: John Doe <jdoe@example.com>" > expected &&
415 + test_cmp expected actual
416 +'
417 +
418 test_done