diff options
Diffstat (limited to 'contrib/remote-helpers/test-hg.sh')
-rwxr-xr-x | contrib/remote-helpers/test-hg.sh | 71 |
1 files changed, 70 insertions, 1 deletions
diff --git a/contrib/remote-helpers/test-hg.sh b/contrib/remote-helpers/test-hg.sh index 53d2504e12..41ea2e8083 100755 --- a/contrib/remote-helpers/test-hg.sh +++ b/contrib/remote-helpers/test-hg.sh @@ -65,6 +65,9 @@ check_push () { 'non-fast-forward') grep "^ ! \[rejected\] *${branch} -> ${branch} (non-fast-forward)$" error || ref_ret=1 ;; + 'fetch-first') + grep "^ ! \[rejected\] *${branch} -> ${branch} (fetch first)$" error || ref_ret=1 + ;; '') grep "^ [a-f0-9]*\.\.[a-f0-9]* *${branch} -> ${branch}$" error || ref_ret=1 ;; @@ -407,7 +410,7 @@ test_expect_success 'remote update bookmark diverge' ' echo diverge > content && git commit -a -m diverge && check_push 1 <<-EOF - diverge:non-fast-forward + diverge:fetch-first EOF ) && @@ -525,6 +528,72 @@ test_expect_success 'remote big push' ' check_bookmark hgrepo new_bmark '' ' +test_expect_success 'remote big push fetch first' ' + test_when_finished "rm -rf hgrepo gitrepo*" && + + ( + hg init hgrepo && + cd hgrepo && + echo zero > content && + hg add content && + hg commit -m zero && + hg bookmark bad_bmark && + hg bookmark good_bmark && + hg bookmark -i good_bmark && + hg -q branch good_branch && + echo "good branch" > content && + hg commit -m "good branch" && + hg -q branch bad_branch && + echo "bad branch" > content && + hg commit -m "bad branch" + ) && + + git clone "hg::hgrepo" gitrepo && + + ( + cd hgrepo && + hg bookmark -f bad_bmark && + echo update_bmark > content && + hg commit -m "update bmark" + ) && + + ( + cd gitrepo && + echo two > content && + git commit -q -a -m two && + + git checkout -q good_bmark && + echo three > content && + git commit -q -a -m three && + + git checkout -q bad_bmark && + echo four > content && + git commit -q -a -m four && + + git checkout -q branches/bad_branch && + echo five > content && + git commit -q -a -m five && + + check_push 1 --all <<-EOF + master + good_bmark + new_bmark:new + new_branch:new + bad_bmark:fetch-first + branches/bad_branch:festch-first + EOF + + git fetch && + + check_push 1 --all <<-EOF + master + good_bmark + bad_bmark:non-fast-forward + branches/bad_branch:non-fast-forward + EOF + ) +' + test_expect_success 'remote double failed push' ' test_when_finished "rm -rf hgrepo gitrepo*" && |