remote-hg: add support for --dry-run
[gitweb.git] / contrib / remote-helpers / test-hg.sh
index 41ea2e8083ac36ed65dc1c56bf1e9882e262cc48..51f3c03875c5872dddacc86f39a7441f741209e4 100755 (executable)
@@ -594,6 +594,44 @@ test_expect_success 'remote big push fetch first' '
        )
 '
 
+test_expect_failure 'remote big push dry-run' '
+       test_when_finished "rm -rf hgrepo gitrepo*" &&
+
+       setup_big_push
+
+       (
+       cd gitrepo &&
+
+       check_push 0 --dry-run --all <<-EOF
+       master
+       good_bmark
+       branches/good_branch
+       new_bmark:new
+       branches/new_branch:new
+       bad_bmark1:non-fast-forward
+       bad_bmark2:non-fast-forward
+       branches/bad_branch:non-fast-forward
+       EOF
+
+       check_push 0 --dry-run master good_bmark new_bmark branches/good_branch branches/new_branch <<-EOF
+       master
+       good_bmark
+       branches/good_branch
+       new_bmark:new
+       branches/new_branch:new
+       EOF
+       ) &&
+
+       check_branch hgrepo default one &&
+       check_branch hgrepo good_branch "good branch" &&
+       check_branch hgrepo bad_branch "bad branch" &&
+       check_branch hgrepo new_branch '' &&
+       check_bookmark hgrepo good_bmark one &&
+       check_bookmark hgrepo bad_bmark1 one &&
+       check_bookmark hgrepo bad_bmark2 one &&
+       check_bookmark hgrepo new_bmark ''
+'
+
 test_expect_success 'remote double failed push' '
        test_when_finished "rm -rf hgrepo gitrepo*" &&