summaryrefslogtreecommitdiff
path: root/contrib/remote-helpers/test-hg.sh
diff options
context:
space:
mode:
authorLibravatar Felipe Contreras <felipe.contreras@gmail.com>2013-05-24 21:29:39 -0500
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-05-28 07:59:57 -0700
commite6e803be79123dff163900c5a55e556cf6d6c9c0 (patch)
treedbb57e016f0b72fd67fc1bd1cd3293495e244929 /contrib/remote-helpers/test-hg.sh
parentremote-hg: update bookmarks when using a remote (diff)
downloadtgif-e6e803be79123dff163900c5a55e556cf6d6c9c0.tar.xz
remote-hg: add remote tests
The logic when working with a local repository is totally different from the one where we work with a remote repository; we need to pull and push from it. All this logic is currently not tested at all, so let's introduce a variable to force the remote behavior. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/remote-helpers/test-hg.sh')
-rwxr-xr-xcontrib/remote-helpers/test-hg.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/contrib/remote-helpers/test-hg.sh b/contrib/remote-helpers/test-hg.sh
index 4e56640101..c36b729770 100755
--- a/contrib/remote-helpers/test-hg.sh
+++ b/contrib/remote-helpers/test-hg.sh
@@ -250,4 +250,42 @@ test_expect_success 'remote push from master branch' '
check_branch hgrepo default one
'
+GIT_REMOTE_HG_TEST_REMOTE=1
+export GIT_REMOTE_HG_TEST_REMOTE
+
+test_expect_success 'remote cloning' '
+ test_when_finished "rm -rf gitrepo*" &&
+
+ (
+ hg init hgrepo &&
+ cd hgrepo &&
+ echo zero > content &&
+ hg add content &&
+ hg commit -m zero
+ ) &&
+
+ git clone "hg::hgrepo" gitrepo &&
+ check gitrepo HEAD zero
+'
+
+test_expect_success 'remote update bookmark' '
+ test_when_finished "rm -rf gitrepo*" &&
+
+ (
+ cd hgrepo &&
+ hg bookmark devel
+ ) &&
+
+ (
+ git clone "hg::hgrepo" gitrepo &&
+ cd gitrepo &&
+ git checkout --quiet devel &&
+ echo devel > content &&
+ git commit -a -m devel &&
+ git push --quiet
+ ) &&
+
+ check_bookmark hgrepo devel devel
+'
+
test_done