File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -118,4 +118,39 @@ test_expect_success 'update bookmark' '
118118 hg -R hgrepo bookmarks | grep "devel\s\+3:"
119119'
120120
121+ author_test () {
122+ echo $1 >> content &&
123+ hg commit -u " $2 " -m " add $1 " &&
124+ echo " $3 " >> ../expected
125+ }
126+
127+ test_expect_success ' authors' '
128+ mkdir -p tmp && cd tmp &&
129+ test_when_finished "cd .. && rm -rf tmp" &&
130+
131+ (
132+ hg init hgrepo &&
133+ cd hgrepo &&
134+
135+ touch content &&
136+ hg add content &&
137+
138+ author_test alpha "" "H G Wells <wells@example.com>" &&
139+ author_test beta "test" "test <unknown>" &&
140+ author_test beta "test <test@example.com> (comment)" "test <unknown>" &&
141+ author_test gamma "<test@example.com>" "Unknown <test@example.com>" &&
142+ author_test delta "name<test@example.com>" "name <test@example.com>" &&
143+ author_test epsilon "name <test@example.com" "name <unknown>" &&
144+ author_test zeta " test " "test <unknown>" &&
145+ author_test eta "test < test@example.com >" "test <test@example.com>" &&
146+ author_test theta "test >test@example.com>" "test <unknown>" &&
147+ author_test iota "test < test <at> example <dot> com>" "test <unknown>"
148+ ) &&
149+
150+ git clone "hg::$PWD/hgrepo" gitrepo &&
151+ git --git-dir=gitrepo/.git log --reverse --format="%an <%ae>" > actual &&
152+
153+ test_cmp expected actual
154+ '
155+
121156test_done
You can’t perform that action at this time.
0 commit comments