Show More
@@ -1,100 +1,289 b'' | |||||
1 | #!/bin/sh |
|
1 | This test tries to exercise the ssh functionality with a dummy script | |
2 |
|
||||
3 | # This test tries to exercise the ssh functionality with a dummy script |
|
|||
4 |
|
2 | |||
5 | cat <<EOF > dummyssh |
|
3 | $ cat <<EOF > dummyssh | |
6 | import sys |
|
4 | > import sys | |
7 | import os |
|
5 | > import os | |
|
6 | > | |||
|
7 | > os.chdir(os.path.dirname(sys.argv[0])) | |||
|
8 | > if sys.argv[1] != "user@dummy": | |||
|
9 | > sys.exit(-1) | |||
|
10 | > | |||
|
11 | > if not os.path.exists("dummyssh"): | |||
|
12 | > sys.exit(-1) | |||
|
13 | > | |||
|
14 | > os.environ["SSH_CLIENT"] = "127.0.0.1 1 2" | |||
|
15 | > | |||
|
16 | > log = open("dummylog", "ab") | |||
|
17 | > log.write("Got arguments") | |||
|
18 | > for i, arg in enumerate(sys.argv[1:]): | |||
|
19 | > log.write(" %d:%s" % (i+1, arg)) | |||
|
20 | > log.write("\n") | |||
|
21 | > log.close() | |||
|
22 | > r = os.system(sys.argv[2]) | |||
|
23 | > sys.exit(bool(r)) | |||
|
24 | > EOF | |||
|
25 | $ hg init remote | |||
|
26 | $ cd remote | |||
8 |
|
27 | |||
9 | os.chdir(os.path.dirname(sys.argv[0])) |
|
28 | creating 'remote | |
10 | if sys.argv[1] != "user@dummy": |
|
|||
11 | sys.exit(-1) |
|
|||
12 |
|
29 | |||
13 | if not os.path.exists("dummyssh"): |
|
30 | $ cat >>afile <<EOF | |
14 | sys.exit(-1) |
|
31 | > 0 | |
15 |
|
32 | > EOF | ||
16 | os.environ["SSH_CLIENT"] = "127.0.0.1 1 2" |
|
33 | $ hg add afile | |
|
34 | $ hg commit -m "0.0" | |||
|
35 | $ cat >>afile <<EOF | |||
|
36 | > 1 | |||
|
37 | > EOF | |||
|
38 | $ hg commit -m "0.1" | |||
|
39 | $ cat >>afile <<EOF | |||
|
40 | > 2 | |||
|
41 | > EOF | |||
|
42 | $ hg commit -m "0.2" | |||
|
43 | $ cat >>afile <<EOF | |||
|
44 | > 3 | |||
|
45 | > EOF | |||
|
46 | $ hg commit -m "0.3" | |||
|
47 | $ hg update -C 0 | |||
|
48 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
49 | $ cat >>afile <<EOF | |||
|
50 | > 1 | |||
|
51 | > EOF | |||
|
52 | $ hg commit -m "1.1" | |||
|
53 | created new head | |||
|
54 | $ cat >>afile <<EOF | |||
|
55 | > 2 | |||
|
56 | > EOF | |||
|
57 | $ hg commit -m "1.2" | |||
|
58 | $ cat >fred <<EOF | |||
|
59 | > a line | |||
|
60 | > EOF | |||
|
61 | $ cat >>afile <<EOF | |||
|
62 | > 3 | |||
|
63 | > EOF | |||
|
64 | $ hg add fred | |||
|
65 | $ hg commit -m "1.3" | |||
|
66 | $ hg mv afile adifferentfile | |||
|
67 | $ hg commit -m "1.3m" | |||
|
68 | $ hg update -C 3 | |||
|
69 | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved | |||
|
70 | $ hg mv afile anotherfile | |||
|
71 | $ hg commit -m "0.3m" | |||
|
72 | $ hg debugindex .hg/store/data/afile.i | |||
|
73 | rev offset length base linkrev nodeid p1 p2 | |||
|
74 | 0 0 3 0 0 362fef284ce2 000000000000 000000000000 | |||
|
75 | 1 3 5 1 1 125144f7e028 362fef284ce2 000000000000 | |||
|
76 | 2 8 7 2 2 4c982badb186 125144f7e028 000000000000 | |||
|
77 | 3 15 9 3 3 19b1fc555737 4c982badb186 000000000000 | |||
|
78 | $ hg debugindex .hg/store/data/adifferentfile.i | |||
|
79 | rev offset length base linkrev nodeid p1 p2 | |||
|
80 | 0 0 75 0 7 2565f3199a74 000000000000 000000000000 | |||
|
81 | $ hg debugindex .hg/store/data/anotherfile.i | |||
|
82 | rev offset length base linkrev nodeid p1 p2 | |||
|
83 | 0 0 75 0 8 2565f3199a74 000000000000 000000000000 | |||
|
84 | $ hg debugindex .hg/store/data/fred.i | |||
|
85 | rev offset length base linkrev nodeid p1 p2 | |||
|
86 | 0 0 8 0 6 12ab3bcc5ea4 000000000000 000000000000 | |||
|
87 | $ hg debugindex .hg/store/00manifest.i | |||
|
88 | rev offset length base linkrev nodeid p1 p2 | |||
|
89 | 0 0 48 0 0 43eadb1d2d06 000000000000 000000000000 | |||
|
90 | 1 48 48 1 1 8b89697eba2c 43eadb1d2d06 000000000000 | |||
|
91 | 2 96 48 2 2 626a32663c2f 8b89697eba2c 000000000000 | |||
|
92 | 3 144 48 3 3 f54c32f13478 626a32663c2f 000000000000 | |||
|
93 | 4 192 58 3 6 de68e904d169 626a32663c2f 000000000000 | |||
|
94 | 5 250 68 3 7 09bb521d218d de68e904d169 000000000000 | |||
|
95 | 6 318 54 6 8 1fde233dfb0f f54c32f13478 000000000000 | |||
|
96 | $ hg verify | |||
|
97 | checking changesets | |||
|
98 | checking manifests | |||
|
99 | crosschecking files in changesets and manifests | |||
|
100 | checking files | |||
|
101 | 4 files, 9 changesets, 7 total revisions | |||
|
102 | $ cd .. | |||
17 |
|
103 | |||
18 | log = open("dummylog", "ab") |
|
104 | clone remote via stream | |
19 | log.write("Got arguments") |
|
|||
20 | for i, arg in enumerate(sys.argv[1:]): |
|
|||
21 | log.write(" %d:%s" % (i+1, arg)) |
|
|||
22 | log.write("\n") |
|
|||
23 | log.close() |
|
|||
24 | r = os.system(sys.argv[2]) |
|
|||
25 | sys.exit(bool(r)) |
|
|||
26 | EOF |
|
|||
27 |
|
105 | |||
28 | hg init remote |
|
106 | $ for i in 0 1 2 3 4 5 6 7 8; do | |
29 | cd remote |
|
107 | > hg clone -e "python ./dummyssh" --uncompressed -r "$i" ssh://user@dummy/remote test-"$i" | |
30 | echo "# creating 'remote'" |
|
108 | > if cd test-"$i"; then | |
31 | cat >>afile <<EOF |
|
109 | > hg verify | |
32 | 0 |
|
110 | > cd .. | |
33 | EOF |
|
111 | > fi | |
34 | hg add afile |
|
112 | > done | |
35 | hg commit -m "0.0" |
|
113 | requesting all changes | |
36 | cat >>afile <<EOF |
|
114 | adding changesets | |
37 | 1 |
|
115 | adding manifests | |
38 | EOF |
|
116 | adding file changes | |
39 | hg commit -m "0.1" |
|
117 | added 1 changesets with 1 changes to 1 files | |
40 | cat >>afile <<EOF |
|
118 | updating to branch default | |
41 | 2 |
|
119 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
42 | EOF |
|
120 | checking changesets | |
43 | hg commit -m "0.2" |
|
121 | checking manifests | |
44 | cat >>afile <<EOF |
|
122 | crosschecking files in changesets and manifests | |
45 | 3 |
|
123 | checking files | |
46 | EOF |
|
124 | 1 files, 1 changesets, 1 total revisions | |
47 | hg commit -m "0.3" |
|
125 | requesting all changes | |
48 | hg update -C 0 |
|
126 | adding changesets | |
49 | cat >>afile <<EOF |
|
127 | adding manifests | |
50 | 1 |
|
128 | adding file changes | |
51 | EOF |
|
129 | added 2 changesets with 2 changes to 1 files | |
52 | hg commit -m "1.1" |
|
130 | updating to branch default | |
53 | cat >>afile <<EOF |
|
131 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
54 | 2 |
|
132 | checking changesets | |
55 | EOF |
|
133 | checking manifests | |
56 | hg commit -m "1.2" |
|
134 | crosschecking files in changesets and manifests | |
57 | cat >fred <<EOF |
|
135 | checking files | |
58 | a line |
|
136 | 1 files, 2 changesets, 2 total revisions | |
59 | EOF |
|
137 | requesting all changes | |
60 | cat >>afile <<EOF |
|
138 | adding changesets | |
61 | 3 |
|
139 | adding manifests | |
62 | EOF |
|
140 | adding file changes | |
63 | hg add fred |
|
141 | added 3 changesets with 3 changes to 1 files | |
64 | hg commit -m "1.3" |
|
142 | updating to branch default | |
65 | hg mv afile adifferentfile |
|
143 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
66 | hg commit -m "1.3m" |
|
144 | checking changesets | |
67 | hg update -C 3 |
|
145 | checking manifests | |
68 | hg mv afile anotherfile |
|
146 | crosschecking files in changesets and manifests | |
69 | hg commit -m "0.3m" |
|
147 | checking files | |
70 | hg debugindex .hg/store/data/afile.i |
|
148 | 1 files, 3 changesets, 3 total revisions | |
71 | hg debugindex .hg/store/data/adifferentfile.i |
|
149 | requesting all changes | |
72 | hg debugindex .hg/store/data/anotherfile.i |
|
150 | adding changesets | |
73 | hg debugindex .hg/store/data/fred.i |
|
151 | adding manifests | |
74 | hg debugindex .hg/store/00manifest.i |
|
152 | adding file changes | |
75 | hg verify |
|
153 | added 4 changesets with 4 changes to 1 files | |
76 | cd .. |
|
154 | updating to branch default | |
77 |
|
155 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||
78 | echo "# clone remote via stream" |
|
156 | checking changesets | |
79 | for i in 0 1 2 3 4 5 6 7 8; do |
|
157 | checking manifests | |
80 | hg clone -e "python ./dummyssh" --uncompressed -r "$i" ssh://user@dummy/remote test-"$i" 2>&1 |
|
158 | crosschecking files in changesets and manifests | |
81 | if cd test-"$i"; then |
|
159 | checking files | |
82 | hg verify |
|
160 | 1 files, 4 changesets, 4 total revisions | |
83 | cd .. |
|
161 | requesting all changes | |
84 | fi |
|
162 | adding changesets | |
85 | done |
|
163 | adding manifests | |
86 | cd test-8 |
|
164 | adding file changes | |
87 | hg pull ../test-7 |
|
165 | added 2 changesets with 2 changes to 1 files | |
88 | hg verify |
|
166 | updating to branch default | |
89 | cd .. |
|
167 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
90 | cd test-1 |
|
168 | checking changesets | |
91 | hg pull -e "python ../dummyssh" -r 4 ssh://user@dummy/remote 2>&1 |
|
169 | checking manifests | |
92 | hg verify |
|
170 | crosschecking files in changesets and manifests | |
93 | hg pull -e "python ../dummyssh" ssh://user@dummy/remote 2>&1 |
|
171 | checking files | |
94 | cd .. |
|
172 | 1 files, 2 changesets, 2 total revisions | |
95 | cd test-2 |
|
173 | requesting all changes | |
96 | hg pull -e "python ../dummyssh" -r 5 ssh://user@dummy/remote 2>&1 |
|
174 | adding changesets | |
97 | hg verify |
|
175 | adding manifests | |
98 | hg pull -e "python ../dummyssh" ssh://user@dummy/remote 2>&1 |
|
176 | adding file changes | |
99 | hg verify |
|
177 | added 3 changesets with 3 changes to 1 files | |
100 | cd .. |
|
178 | updating to branch default | |
|
179 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
180 | checking changesets | |||
|
181 | checking manifests | |||
|
182 | crosschecking files in changesets and manifests | |||
|
183 | checking files | |||
|
184 | 1 files, 3 changesets, 3 total revisions | |||
|
185 | requesting all changes | |||
|
186 | adding changesets | |||
|
187 | adding manifests | |||
|
188 | adding file changes | |||
|
189 | added 4 changesets with 5 changes to 2 files | |||
|
190 | updating to branch default | |||
|
191 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
192 | checking changesets | |||
|
193 | checking manifests | |||
|
194 | crosschecking files in changesets and manifests | |||
|
195 | checking files | |||
|
196 | 2 files, 4 changesets, 5 total revisions | |||
|
197 | requesting all changes | |||
|
198 | adding changesets | |||
|
199 | adding manifests | |||
|
200 | adding file changes | |||
|
201 | added 5 changesets with 6 changes to 3 files | |||
|
202 | updating to branch default | |||
|
203 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
204 | checking changesets | |||
|
205 | checking manifests | |||
|
206 | crosschecking files in changesets and manifests | |||
|
207 | checking files | |||
|
208 | 3 files, 5 changesets, 6 total revisions | |||
|
209 | requesting all changes | |||
|
210 | adding changesets | |||
|
211 | adding manifests | |||
|
212 | adding file changes | |||
|
213 | added 5 changesets with 5 changes to 2 files | |||
|
214 | updating to branch default | |||
|
215 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
216 | checking changesets | |||
|
217 | checking manifests | |||
|
218 | crosschecking files in changesets and manifests | |||
|
219 | checking files | |||
|
220 | 2 files, 5 changesets, 5 total revisions | |||
|
221 | $ cd test-8 | |||
|
222 | $ hg pull ../test-7 | |||
|
223 | pulling from ../test-7 | |||
|
224 | searching for changes | |||
|
225 | adding changesets | |||
|
226 | adding manifests | |||
|
227 | adding file changes | |||
|
228 | added 4 changesets with 2 changes to 3 files (+1 heads) | |||
|
229 | (run 'hg heads' to see heads, 'hg merge' to merge) | |||
|
230 | $ hg verify | |||
|
231 | checking changesets | |||
|
232 | checking manifests | |||
|
233 | crosschecking files in changesets and manifests | |||
|
234 | checking files | |||
|
235 | 4 files, 9 changesets, 7 total revisions | |||
|
236 | $ cd .. | |||
|
237 | $ cd test-1 | |||
|
238 | $ hg pull -e "python ../dummyssh" -r 4 ssh://user@dummy/remote | |||
|
239 | pulling from ssh://user@dummy/remote | |||
|
240 | searching for changes | |||
|
241 | adding changesets | |||
|
242 | adding manifests | |||
|
243 | adding file changes | |||
|
244 | added 1 changesets with 0 changes to 1 files (+1 heads) | |||
|
245 | (run 'hg heads' to see heads, 'hg merge' to merge) | |||
|
246 | $ hg verify | |||
|
247 | checking changesets | |||
|
248 | checking manifests | |||
|
249 | crosschecking files in changesets and manifests | |||
|
250 | checking files | |||
|
251 | 1 files, 3 changesets, 2 total revisions | |||
|
252 | $ hg pull -e "python ../dummyssh" ssh://user@dummy/remote | |||
|
253 | pulling from ssh://user@dummy/remote | |||
|
254 | searching for changes | |||
|
255 | adding changesets | |||
|
256 | adding manifests | |||
|
257 | adding file changes | |||
|
258 | added 6 changesets with 5 changes to 4 files | |||
|
259 | (run 'hg update' to get a working copy) | |||
|
260 | $ cd .. | |||
|
261 | $ cd test-2 | |||
|
262 | $ hg pull -e "python ../dummyssh" -r 5 ssh://user@dummy/remote | |||
|
263 | pulling from ssh://user@dummy/remote | |||
|
264 | searching for changes | |||
|
265 | adding changesets | |||
|
266 | adding manifests | |||
|
267 | adding file changes | |||
|
268 | added 2 changesets with 0 changes to 1 files (+1 heads) | |||
|
269 | (run 'hg heads' to see heads, 'hg merge' to merge) | |||
|
270 | $ hg verify | |||
|
271 | checking changesets | |||
|
272 | checking manifests | |||
|
273 | crosschecking files in changesets and manifests | |||
|
274 | checking files | |||
|
275 | 1 files, 5 changesets, 3 total revisions | |||
|
276 | $ hg pull -e "python ../dummyssh" ssh://user@dummy/remote | |||
|
277 | pulling from ssh://user@dummy/remote | |||
|
278 | searching for changes | |||
|
279 | adding changesets | |||
|
280 | adding manifests | |||
|
281 | adding file changes | |||
|
282 | added 4 changesets with 4 changes to 4 files | |||
|
283 | (run 'hg update' to get a working copy) | |||
|
284 | $ hg verify | |||
|
285 | checking changesets | |||
|
286 | checking manifests | |||
|
287 | crosschecking files in changesets and manifests | |||
|
288 | checking files | |||
|
289 | 4 files, 9 changesets, 7 total revisions |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now