remote-bzr: include authors field in pushed commits
authordequis <dx@dxzone.com.ar>
Wed, 9 Apr 2014 18:50:03 +0000 (13:50 -0500)
committerJunio C Hamano <gitster@pobox.com>
Wed, 9 Apr 2014 21:20:48 +0000 (14:20 -0700)
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>
contrib/remote-helpers/git-remote-bzr
contrib/remote-helpers/test-bzr.sh
index 7f354c88e70664fc049273e8487406827c965602..6ca1e975c3e01f1b414d9b186f97492e5f9e44c6 100755 (executable)
@@ -618,10 +618,12 @@ def parse_commit(parser):
         files[path] = f
 
     committer, date, tz = committer
+    author, _, _ = author
     parents = [mark_to_rev(p) for p in parents]
     revid = bzrlib.generate_ids.gen_revision_id(committer, date)
     props = {}
     props['branch-nick'] = branch.nick
+    props['authors'] = author
 
     mtree = CustomTree(branch, revid, parents, files)
     changes = mtree.iter_changes()
index 1e53ff9a584a302366dcbd647a2e27db3fd1b9fe..11a6e1848472ea973902760048f5f90ab1bb53bf 100755 (executable)
@@ -391,4 +391,28 @@ test_expect_success 'export utf-8 authors' '
        test_cmp expected actual
 '
 
+test_expect_success 'push different author' '
+       test_when_finished "rm -rf bzrrepo gitrepo" &&
+
+       bzr init bzrrepo &&
+
+       (
+       git init gitrepo &&
+       cd gitrepo &&
+       echo john >> content &&
+       git add content &&
+       git commit -m john --author "John Doe <jdoe@example.com>" &&
+       git remote add bzr "bzr::../bzrrepo" &&
+       git push bzr master
+       ) &&
+
+       (
+       cd bzrrepo &&
+       bzr log | grep "^author: " > ../actual
+       ) &&
+
+       echo "author: John Doe <jdoe@example.com>" > expected &&
+       test_cmp expected actual
+'
+
 test_done