remote-hg: trivial cleanups
[gitweb.git] / contrib / remote-helpers / test-hg.sh
index f986db0ff009b88d6d3f06d32f6216e42958c96c..af27a0f65fae51771740bc5a31671c8a976f8a1d 100755 (executable)
@@ -37,6 +37,8 @@ setup () {
        (
        echo "[ui]"
        echo "username = H G Wells <wells@example.com>"
+       echo "[extensions]"
+       echo "mq ="
        ) >> "$HOME"/.hgrc
 }
 
@@ -53,7 +55,7 @@ test_expect_success 'cloning' '
        hg commit -m zero
        ) &&
 
-       git clone "hg::$PWD/hgrepo" gitrepo &&
+       git clone "hg::hgrepo" gitrepo &&
        check gitrepo zero master
 '
 
@@ -67,12 +69,12 @@ test_expect_success 'cloning with branches' '
        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
 '
 
@@ -86,7 +88,7 @@ test_expect_success 'cloning with bookmarks' '
        hg commit -m feature-a
        ) &&
 
-       git clone "hg::$PWD/hgrepo" gitrepo &&
+       git clone "hg::hgrepo" gitrepo &&
        check gitrepo feature-a feature-a
 '
 
@@ -98,7 +100,7 @@ test_expect_success 'cloning with detached head' '
        hg update -r 0
        ) &&
 
-       git clone "hg::$PWD/hgrepo" gitrepo &&
+       git clone "hg::hgrepo" gitrepo &&
        check gitrepo zero master
 '
 
@@ -111,7 +113,7 @@ test_expect_success 'update bookmark' '
        ) &&
 
        (
-       git clone "hg::$PWD/hgrepo" gitrepo &&
+       git clone "hg::hgrepo" gitrepo &&
        cd gitrepo &&
        git checkout --quiet devel &&
        echo devel > content &&
@@ -155,10 +157,48 @@ test_expect_success 'authors' '
        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