From 410e0d74eccde524a9fef7de9f9ddbdbbb9c2df2 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Sat, 9 Jul 2016 09:44:29 +0200 Subject: [PATCH] test: add test for rename/copy detection --- test/main.t | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/test/main.t b/test/main.t index f932610..1966ee7 100755 --- a/test/main.t +++ b/test/main.t @@ -474,6 +474,47 @@ test_expect_success 'remote new bookmark multiple branch head' ' # cleanup previous stuff rm -rf hgrepo +testcopyrenamedesc='push commits with copy and rename' +testcopyrename=' + test_when_finished "rm -rf gitrepo hgrepo" && + + ( + hg init hgrepo && + cd hgrepo && + echo zero > content && + hg add content && + hg commit -m zero + ) && + + git clone "hg::hgrepo" gitrepo && + + ( + cd gitrepo && + cp content content-copy && + echo one > content && + git add content content-copy && + git commit -m copy && + git mv content-copy content-moved + git commit -m moved && + git push origin master + ) && + + ( + hg -R hgrepo update && + test_cmp gitrepo/content hgrepo/content + test_cmp gitrepo/content-moved hgrepo/content-moved + cd hgrepo && + test `hg log -f content-moved | grep -c changeset` -eq 3 + ) +' + +if test "$CAPABILITY_PUSH" = "t" +then +test_expect_success "$testcopyrenamedesc" "$testcopyrename" +else +test_expect_failure "$testcopyrenamedesc" "$testcopyrename" +fi + test_expect_success 'fetch special filenames' ' test_when_finished "rm -rf hgrepo gitrepo && LC_ALL=C" &&