3 # Copyright (c) 2010 Sverre Rabbelier
6 test_description
='Test remote-helper import and export commands'
10 if test_have_prereq PYTHON
&& "$PYTHON_PATH" -c '
12 if sys.hexversion < 0x02040000:
18 skip_all
='skipping git remote-hg tests: requires Python 2.4 or newer'
22 # Call cmp with the arguments -x ".hg" -x ".git" <left> <right>
25 $DIFF -u -x ".hg" -x ".git" $1 $2
30 test_expect_success
'setup repository' '
31 printf "[ui]\nusername = A U Thor <author@example.com>" > \
35 hg clone "$ROOT/server" public &&
43 test_expect_success
'cloning from local repo' '
44 git clone "hg::file://${ROOT}/server" localclone &&
45 vcs_cmp public localclone
48 test_expect_success
'cloning from remote repo' '
49 git clone "hg::remote://${ROOT}/server" clone &&
53 test_expect_success
'create new commit on remote' '
55 echo content >>file &&
56 hg commit -A -m two &&
60 test_expect_success
'pulling from local repo' '
61 (cd localclone && git pull) &&
62 vcs_cmp public localclone
65 test_expect_success
'pulling from remote remote' '
66 (cd clone && git pull) &&
70 test_expect_success
'pushing to local empty repo' '
73 git push --all "hg::file://${ROOT}/localempty") &&
76 vcs_cmp localclone localempty
79 test_expect_success
'pushing to remote empty repo' '
82 git push --all "hg::remote://${ROOT}/empty") &&
85 vcs_cmp localclone empty
88 test_expect_success
'pushing to local repo' '
90 echo content >>file &&
91 git commit -a -m three &&
95 vcs_cmp localclone server
98 test_expect_success
'synch with changes from localclone' '
103 test_expect_success
'pushing remote local repo' '
105 echo content >>file &&
106 git commit -a -m four &&
113 test_expect_success
'creating new branch' '
115 hg branch different-branch &&
116 echo different >> file &&
121 test_expect_success
'pull in new branch to local repository' '
123 git fetch origin default &&
124 test_must_fail git rev-parse -q --verify refs/remotes/origin/different-branch &&
126 git rev-parse --no-revs --verify refs/remotes/origin/different-branch)
129 test_expect_success
'pull in new branch to remote repository' '
131 git fetch origin default &&
132 test_must_fail git rev-parse -q --verify refs/remotes/origin/different-branch &&
134 git rev-parse --no-revs --verify refs/remotes/origin/different-branch)