aboutsummaryrefslogtreecommitdiff
path: root/contrib/remote-helpers
diff options
context:
space:
mode:
authordequis <dx@dxzone.com.ar>2014-04-09 13:50:03 -0500
committerJunio C Hamano <gitster@pobox.com>2014-04-09 14:20:48 -0700
commit62210887f783d942ddfa918b3974b42311d3ef9d (patch)
treef1c5ca54ceef3574913ee20cb8d1a73cb3b5679f /contrib/remote-helpers
parent5ff569908dd6e174c2d81df8e25ecc8af34fc5a8 (diff)
downloadgit-62210887f783d942ddfa918b3974b42311d3ef9d.tar.gz
git-62210887f783d942ddfa918b3974b42311d3ef9d.tar.xz
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>
Diffstat (limited to 'contrib/remote-helpers')
-rwxr-xr-xcontrib/remote-helpers/git-remote-bzr2
-rwxr-xr-xcontrib/remote-helpers/test-bzr.sh24
2 files changed, 26 insertions, 0 deletions
diff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr
index 7f354c88e..6ca1e975c 100755
--- a/contrib/remote-helpers/git-remote-bzr
+++ b/contrib/remote-helpers/git-remote-bzr
@@ -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()
diff --git a/contrib/remote-helpers/test-bzr.sh b/contrib/remote-helpers/test-bzr.sh
index 1e53ff9a5..11a6e1848 100755
--- a/contrib/remote-helpers/test-bzr.sh
+++ b/contrib/remote-helpers/test-bzr.sh
@@ -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