Mercurial > hg
annotate tests/test-ssh @ 2612:ffb895f16925
add support for streaming clone.
existing clone code uses pull to get changes from remote repo. is very
slow, uses lots of memory and cpu.
new clone code has server write file data straight to client, client
writes file data straight to disk. memory and cpu used are very low,
clone is much faster over lan.
new client can still clone with pull, can still clone from older servers.
new server can still serve older clients.
author | Vadim Gelfer <vadim.gelfer@gmail.com> |
---|---|
date | Fri, 14 Jul 2006 11:17:22 -0700 |
parents | e8c4f3d3df8c |
children | 479e26afa10f |
rev | line source |
---|---|
1110 | 1 #!/bin/sh |
2 | |
3 # This test tries to exercise the ssh functionality with a dummy script | |
4 | |
5 cat <<'EOF' > dummyssh | |
6 #!/bin/sh | |
7 # this attempts to deal with relative pathnames | |
8 cd `dirname $0` | |
9 | |
10 # check for proper args | |
11 if [ $1 != "user@dummy" ] ; then | |
12 exit -1 | |
13 fi | |
14 | |
15 # check that we're in the right directory | |
1168
235e0effa672
Fixed two tests to run with bourne shell.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1110
diff
changeset
|
16 if [ ! -x dummyssh ] ; then |
1110 | 17 exit -1 |
18 fi | |
19 | |
20 echo Got arguments 1:$1 2:$2 3:$3 4:$4 5:$5 >> dummylog | |
21 $2 | |
22 EOF | |
23 chmod +x dummyssh | |
24 | |
25 echo "# creating 'remote'" | |
26 hg init remote | |
27 cd remote | |
28 echo this > foo | |
1933
7544700fd931
Use 'hg ci -d "1000000 0"' in tests to circumvent problem with leading zero.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1168
diff
changeset
|
29 hg ci -A -m "init" -d "1000000 0" foo |
1110 | 30 |
31 cd .. | |
32 | |
2612
ffb895f16925
add support for streaming clone.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2439
diff
changeset
|
33 echo "# clone remote via stream" |
ffb895f16925
add support for streaming clone.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2439
diff
changeset
|
34 hg clone -e ./dummyssh ssh://user@dummy/remote local-stream 2>&1 | \ |
ffb895f16925
add support for streaming clone.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2439
diff
changeset
|
35 sed -e 's/[0-9][0-9.]*/XXX/g' |
ffb895f16925
add support for streaming clone.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2439
diff
changeset
|
36 cd local-stream |
ffb895f16925
add support for streaming clone.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2439
diff
changeset
|
37 hg verify |
ffb895f16925
add support for streaming clone.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2439
diff
changeset
|
38 cd .. |
ffb895f16925
add support for streaming clone.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2439
diff
changeset
|
39 |
ffb895f16925
add support for streaming clone.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2439
diff
changeset
|
40 echo "# clone remote via pull" |
ffb895f16925
add support for streaming clone.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2439
diff
changeset
|
41 hg clone -e ./dummyssh --pull ssh://user@dummy/remote local |
1110 | 42 |
43 echo "# verify" | |
44 cd local | |
45 hg verify | |
46 | |
47 echo "# empty default pull" | |
48 hg paths | |
49 hg pull -e ../dummyssh | |
50 | |
51 echo "# local change" | |
52 echo bleah > foo | |
1933
7544700fd931
Use 'hg ci -d "1000000 0"' in tests to circumvent problem with leading zero.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1168
diff
changeset
|
53 hg ci -m "add" -d "1000000 0" |
1110 | 54 |
55 echo "# updating rc" | |
56 echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc | |
57 echo "[ui]" >> .hg/hgrc | |
58 echo "ssh = ../dummyssh" >> .hg/hgrc | |
59 | |
60 echo "# find outgoing" | |
61 hg out ssh://user@dummy/remote | |
62 | |
1982
70ba0c86da8b
Added test for incoming via ssh.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1933
diff
changeset
|
63 echo "# find incoming on the remote side" |
70ba0c86da8b
Added test for incoming via ssh.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1933
diff
changeset
|
64 hg incoming -R ../remote -e ../dummyssh ssh://user@dummy/local |
70ba0c86da8b
Added test for incoming via ssh.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1933
diff
changeset
|
65 |
1110 | 66 echo "# push" |
67 hg push | |
68 | |
69 cd ../remote | |
70 | |
71 echo "# check remote tip" | |
72 hg tip | |
73 hg verify | |
74 hg cat foo | |
75 | |
2439
e8c4f3d3df8c
extend network protocol to stop clients from locking servers
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1982
diff
changeset
|
76 echo z > z |
e8c4f3d3df8c
extend network protocol to stop clients from locking servers
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1982
diff
changeset
|
77 hg ci -A -m z -d '1000001 0' z |
e8c4f3d3df8c
extend network protocol to stop clients from locking servers
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1982
diff
changeset
|
78 |
e8c4f3d3df8c
extend network protocol to stop clients from locking servers
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1982
diff
changeset
|
79 cd ../local |
e8c4f3d3df8c
extend network protocol to stop clients from locking servers
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1982
diff
changeset
|
80 echo r > r |
e8c4f3d3df8c
extend network protocol to stop clients from locking servers
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1982
diff
changeset
|
81 hg ci -A -m z -d '1000002 0' r |
e8c4f3d3df8c
extend network protocol to stop clients from locking servers
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1982
diff
changeset
|
82 |
e8c4f3d3df8c
extend network protocol to stop clients from locking servers
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1982
diff
changeset
|
83 echo "# push should fail" |
e8c4f3d3df8c
extend network protocol to stop clients from locking servers
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1982
diff
changeset
|
84 hg push |
e8c4f3d3df8c
extend network protocol to stop clients from locking servers
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1982
diff
changeset
|
85 |
e8c4f3d3df8c
extend network protocol to stop clients from locking servers
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1982
diff
changeset
|
86 echo "# push should succeed" |
e8c4f3d3df8c
extend network protocol to stop clients from locking servers
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1982
diff
changeset
|
87 hg push -f |
e8c4f3d3df8c
extend network protocol to stop clients from locking servers
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1982
diff
changeset
|
88 |
1110 | 89 cd .. |
90 cat dummylog |