Skip to content

Commit 6221088

Browse files
dequisgitster
authored andcommitted
remote-bzr: include authors field in pushed commits
Tests-by: Felipe Contreras <[email protected]> Signed-off-by: Felipe Contreras <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5ff5699 commit 6221088

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

contrib/remote-helpers/git-remote-bzr

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,10 +618,12 @@ def parse_commit(parser):
618618
files[path] = f
619619

620620
committer, date, tz = committer
621+
author, _, _ = author
621622
parents = [mark_to_rev(p) for p in parents]
622623
revid = bzrlib.generate_ids.gen_revision_id(committer, date)
623624
props = {}
624625
props['branch-nick'] = branch.nick
626+
props['authors'] = author
625627

626628
mtree = CustomTree(branch, revid, parents, files)
627629
changes = mtree.iter_changes()

contrib/remote-helpers/test-bzr.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,4 +391,28 @@ test_expect_success 'export utf-8 authors' '
391391
test_cmp expected actual
392392
'
393393

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 <[email protected]>" &&
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 <[email protected]>" > expected &&
415+
test_cmp expected actual
416+
'
417+
394418
test_done

0 commit comments

Comments
 (0)