Skip to content

Commit

Permalink
remote-bzr: include authors field in pushed commits
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
dequis authored and Junio C Hamano committed Apr 9, 2014
1 parent 5ff5699 commit 6221088
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions contrib/remote-helpers/git-remote-bzr
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
24 changes: 24 additions & 0 deletions contrib/remote-helpers/test-bzr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 6221088

Please sign in to comment.