(
echo "[ui]"
echo "username = H G Wells <wells@example.com>"
+ echo "[extensions]"
+ echo "mq ="
) >> "$HOME"/.hgrc
}
hg commit -m zero
) &&
- git clone "hg::$PWD/hgrepo" gitrepo &&
+ git clone "hg::hgrepo" gitrepo &&
check gitrepo zero master
'
hg commit -m next
) &&
- git clone "hg::$PWD/hgrepo" gitrepo &&
+ git clone "hg::hgrepo" gitrepo &&
check gitrepo next next &&
(cd hgrepo && hg checkout default) &&
- git clone "hg::$PWD/hgrepo" gitrepo2 &&
+ git clone "hg::hgrepo" gitrepo2 &&
check gitrepo2 zero master
'
hg commit -m feature-a
) &&
- git clone "hg::$PWD/hgrepo" gitrepo &&
+ git clone "hg::hgrepo" gitrepo &&
check gitrepo feature-a feature-a
'
hg update -r 0
) &&
- git clone "hg::$PWD/hgrepo" gitrepo &&
+ git clone "hg::hgrepo" gitrepo &&
check gitrepo zero master
'
) &&
(
- git clone "hg::$PWD/hgrepo" gitrepo &&
+ git clone "hg::hgrepo" gitrepo &&
cd gitrepo &&
git checkout --quiet devel &&
echo devel > content &&
hg -R hgrepo bookmarks | egrep "devel[ ]+3:"
'
+# cleanup previous stuff
+rm -rf hgrepo
+
author_test () {
echo $1 >> content &&
hg commit -u "$2" -m "add $1" &&
}
test_expect_success 'authors' '
- mkdir -p tmp && cd tmp &&
- test_when_finished "cd .. && rm -rf tmp" &&
+ test_when_finished "rm -rf hgrepo gitrepo" &&
(
hg init hgrepo &&
touch content &&
hg add content &&
+ > ../expected &&
author_test alpha "" "H G Wells <wells@example.com>" &&
author_test beta "test" "test <unknown>" &&
author_test beta "test <test@example.com> (comment)" "test <test@example.com>" &&
author_test kappa "test@example.com" "Unknown <test@example.com>"
) &&
- git clone "hg::$PWD/hgrepo" gitrepo &&
+ git clone "hg::hgrepo" gitrepo &&
git --git-dir=gitrepo/.git log --reverse --format="%an <%ae>" > actual &&
test_cmp expected actual
'
+test_expect_success 'strip' '
+ test_when_finished "rm -rf hgrepo gitrepo" &&
+
+ (
+ hg init hgrepo &&
+ cd hgrepo &&
+
+ echo one >> content &&
+ hg add content &&
+ hg commit -m one &&
+
+ echo two >> content &&
+ hg commit -m two
+ ) &&
+
+ git clone "hg::hgrepo" gitrepo &&
+
+ (
+ cd hgrepo &&
+ hg strip 1 &&
+
+ echo three >> content &&
+ hg commit -m three &&
+
+ echo four >> content &&
+ hg commit -m four
+ ) &&
+
+ (
+ cd gitrepo &&
+ git fetch &&
+ git log --format="%s" origin/master > ../actual
+ ) &&
+
+ hg -R hgrepo log --template "{desc}\n" > expected &&
+ test_cmp actual expected
+'
+
test_done