##// END OF EJS Templates
test: use generaldelta in 'test-ssh.t'...
Pierre-Yves David -
r26931:dc2016eb default
parent child Browse files
Show More
@@ -1,534 +1,539
1
1
2 This test tries to exercise the ssh functionality with a dummy script
2 This test tries to exercise the ssh functionality with a dummy script
3
3
4 $ cat <<EOF >> $HGRCPATH
5 > [format]
6 > usegeneraldelta=yes
7 > EOF
8
4 creating 'remote' repo
9 creating 'remote' repo
5
10
6 $ hg init remote
11 $ hg init remote
7 $ cd remote
12 $ cd remote
8 $ echo this > foo
13 $ echo this > foo
9 $ echo this > fooO
14 $ echo this > fooO
10 $ hg ci -A -m "init" foo fooO
15 $ hg ci -A -m "init" foo fooO
11
16
12 insert a closed branch (issue4428)
17 insert a closed branch (issue4428)
13
18
14 $ hg up null
19 $ hg up null
15 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
20 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
16 $ hg branch closed
21 $ hg branch closed
17 marked working directory as branch closed
22 marked working directory as branch closed
18 (branches are permanent and global, did you want a bookmark?)
23 (branches are permanent and global, did you want a bookmark?)
19 $ hg ci -mc0
24 $ hg ci -mc0
20 $ hg ci --close-branch -mc1
25 $ hg ci --close-branch -mc1
21 $ hg up -q default
26 $ hg up -q default
22
27
23 configure for serving
28 configure for serving
24
29
25 $ cat <<EOF > .hg/hgrc
30 $ cat <<EOF > .hg/hgrc
26 > [server]
31 > [server]
27 > uncompressed = True
32 > uncompressed = True
28 >
33 >
29 > [hooks]
34 > [hooks]
30 > changegroup = printenv.py changegroup-in-remote 0 ../dummylog
35 > changegroup = printenv.py changegroup-in-remote 0 ../dummylog
31 > EOF
36 > EOF
32 $ cd ..
37 $ cd ..
33
38
34 repo not found error
39 repo not found error
35
40
36 $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/nonexistent local
41 $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/nonexistent local
37 remote: abort: repository nonexistent not found!
42 remote: abort: repository nonexistent not found!
38 abort: no suitable response from remote hg!
43 abort: no suitable response from remote hg!
39 [255]
44 [255]
40
45
41 non-existent absolute path
46 non-existent absolute path
42
47
43 $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/`pwd`/nonexistent local
48 $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/`pwd`/nonexistent local
44 remote: abort: repository $TESTTMP/nonexistent not found!
49 remote: abort: repository $TESTTMP/nonexistent not found!
45 abort: no suitable response from remote hg!
50 abort: no suitable response from remote hg!
46 [255]
51 [255]
47
52
48 clone remote via stream
53 clone remote via stream
49
54
50 $ hg clone -e "python \"$TESTDIR/dummyssh\"" --uncompressed ssh://user@dummy/remote local-stream
55 $ hg clone -e "python \"$TESTDIR/dummyssh\"" --uncompressed ssh://user@dummy/remote local-stream
51 streaming all changes
56 streaming all changes
52 4 files to transfer, 615 bytes of data
57 4 files to transfer, 615 bytes of data
53 transferred 615 bytes in * seconds (*) (glob)
58 transferred 615 bytes in * seconds (*) (glob)
54 searching for changes
59 searching for changes
55 no changes found
60 no changes found
56 updating to branch default
61 updating to branch default
57 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
62 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
58 $ cd local-stream
63 $ cd local-stream
59 $ hg verify
64 $ hg verify
60 checking changesets
65 checking changesets
61 checking manifests
66 checking manifests
62 crosschecking files in changesets and manifests
67 crosschecking files in changesets and manifests
63 checking files
68 checking files
64 2 files, 3 changesets, 2 total revisions
69 2 files, 3 changesets, 2 total revisions
65 $ hg branches
70 $ hg branches
66 default 0:1160648e36ce
71 default 0:1160648e36ce
67 $ cd ..
72 $ cd ..
68
73
69 clone bookmarks via stream
74 clone bookmarks via stream
70
75
71 $ hg -R local-stream book mybook
76 $ hg -R local-stream book mybook
72 $ hg clone -e "python \"$TESTDIR/dummyssh\"" --uncompressed ssh://user@dummy/local-stream stream2
77 $ hg clone -e "python \"$TESTDIR/dummyssh\"" --uncompressed ssh://user@dummy/local-stream stream2
73 streaming all changes
78 streaming all changes
74 4 files to transfer, 615 bytes of data
79 4 files to transfer, 615 bytes of data
75 transferred 615 bytes in * seconds (*) (glob)
80 transferred 615 bytes in * seconds (*) (glob)
76 searching for changes
81 searching for changes
77 no changes found
82 no changes found
78 updating to branch default
83 updating to branch default
79 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
84 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
80 $ cd stream2
85 $ cd stream2
81 $ hg book
86 $ hg book
82 mybook 0:1160648e36ce
87 mybook 0:1160648e36ce
83 $ cd ..
88 $ cd ..
84 $ rm -rf local-stream stream2
89 $ rm -rf local-stream stream2
85
90
86 clone remote via pull
91 clone remote via pull
87
92
88 $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local
93 $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local
89 requesting all changes
94 requesting all changes
90 adding changesets
95 adding changesets
91 adding manifests
96 adding manifests
92 adding file changes
97 adding file changes
93 added 3 changesets with 2 changes to 2 files
98 added 3 changesets with 2 changes to 2 files
94 updating to branch default
99 updating to branch default
95 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
100 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
96
101
97 verify
102 verify
98
103
99 $ cd local
104 $ cd local
100 $ hg verify
105 $ hg verify
101 checking changesets
106 checking changesets
102 checking manifests
107 checking manifests
103 crosschecking files in changesets and manifests
108 crosschecking files in changesets and manifests
104 checking files
109 checking files
105 2 files, 3 changesets, 2 total revisions
110 2 files, 3 changesets, 2 total revisions
106 $ echo '[hooks]' >> .hg/hgrc
111 $ echo '[hooks]' >> .hg/hgrc
107 $ echo "changegroup = printenv.py changegroup-in-local 0 ../dummylog" >> .hg/hgrc
112 $ echo "changegroup = printenv.py changegroup-in-local 0 ../dummylog" >> .hg/hgrc
108
113
109 empty default pull
114 empty default pull
110
115
111 $ hg paths
116 $ hg paths
112 default = ssh://user@dummy/remote
117 default = ssh://user@dummy/remote
113 $ hg pull -e "python \"$TESTDIR/dummyssh\""
118 $ hg pull -e "python \"$TESTDIR/dummyssh\""
114 pulling from ssh://user@dummy/remote
119 pulling from ssh://user@dummy/remote
115 searching for changes
120 searching for changes
116 no changes found
121 no changes found
117
122
118 pull from wrong ssh URL
123 pull from wrong ssh URL
119
124
120 $ hg pull -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/doesnotexist
125 $ hg pull -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/doesnotexist
121 pulling from ssh://user@dummy/doesnotexist
126 pulling from ssh://user@dummy/doesnotexist
122 remote: abort: repository doesnotexist not found!
127 remote: abort: repository doesnotexist not found!
123 abort: no suitable response from remote hg!
128 abort: no suitable response from remote hg!
124 [255]
129 [255]
125
130
126 local change
131 local change
127
132
128 $ echo bleah > foo
133 $ echo bleah > foo
129 $ hg ci -m "add"
134 $ hg ci -m "add"
130
135
131 updating rc
136 updating rc
132
137
133 $ echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc
138 $ echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc
134 $ echo "[ui]" >> .hg/hgrc
139 $ echo "[ui]" >> .hg/hgrc
135 $ echo "ssh = python \"$TESTDIR/dummyssh\"" >> .hg/hgrc
140 $ echo "ssh = python \"$TESTDIR/dummyssh\"" >> .hg/hgrc
136
141
137 find outgoing
142 find outgoing
138
143
139 $ hg out ssh://user@dummy/remote
144 $ hg out ssh://user@dummy/remote
140 comparing with ssh://user@dummy/remote
145 comparing with ssh://user@dummy/remote
141 searching for changes
146 searching for changes
142 changeset: 3:a28a9d1a809c
147 changeset: 3:a28a9d1a809c
143 tag: tip
148 tag: tip
144 parent: 0:1160648e36ce
149 parent: 0:1160648e36ce
145 user: test
150 user: test
146 date: Thu Jan 01 00:00:00 1970 +0000
151 date: Thu Jan 01 00:00:00 1970 +0000
147 summary: add
152 summary: add
148
153
149
154
150 find incoming on the remote side
155 find incoming on the remote side
151
156
152 $ hg incoming -R ../remote -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/local
157 $ hg incoming -R ../remote -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/local
153 comparing with ssh://user@dummy/local
158 comparing with ssh://user@dummy/local
154 searching for changes
159 searching for changes
155 changeset: 3:a28a9d1a809c
160 changeset: 3:a28a9d1a809c
156 tag: tip
161 tag: tip
157 parent: 0:1160648e36ce
162 parent: 0:1160648e36ce
158 user: test
163 user: test
159 date: Thu Jan 01 00:00:00 1970 +0000
164 date: Thu Jan 01 00:00:00 1970 +0000
160 summary: add
165 summary: add
161
166
162
167
163 find incoming on the remote side (using absolute path)
168 find incoming on the remote side (using absolute path)
164
169
165 $ hg incoming -R ../remote -e "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/`pwd`"
170 $ hg incoming -R ../remote -e "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/`pwd`"
166 comparing with ssh://user@dummy/$TESTTMP/local
171 comparing with ssh://user@dummy/$TESTTMP/local
167 searching for changes
172 searching for changes
168 changeset: 3:a28a9d1a809c
173 changeset: 3:a28a9d1a809c
169 tag: tip
174 tag: tip
170 parent: 0:1160648e36ce
175 parent: 0:1160648e36ce
171 user: test
176 user: test
172 date: Thu Jan 01 00:00:00 1970 +0000
177 date: Thu Jan 01 00:00:00 1970 +0000
173 summary: add
178 summary: add
174
179
175
180
176 push
181 push
177
182
178 $ hg push
183 $ hg push
179 pushing to ssh://user@dummy/remote
184 pushing to ssh://user@dummy/remote
180 searching for changes
185 searching for changes
181 remote: adding changesets
186 remote: adding changesets
182 remote: adding manifests
187 remote: adding manifests
183 remote: adding file changes
188 remote: adding file changes
184 remote: added 1 changesets with 1 changes to 1 files
189 remote: added 1 changesets with 1 changes to 1 files
185 $ cd ../remote
190 $ cd ../remote
186
191
187 check remote tip
192 check remote tip
188
193
189 $ hg tip
194 $ hg tip
190 changeset: 3:a28a9d1a809c
195 changeset: 3:a28a9d1a809c
191 tag: tip
196 tag: tip
192 parent: 0:1160648e36ce
197 parent: 0:1160648e36ce
193 user: test
198 user: test
194 date: Thu Jan 01 00:00:00 1970 +0000
199 date: Thu Jan 01 00:00:00 1970 +0000
195 summary: add
200 summary: add
196
201
197 $ hg verify
202 $ hg verify
198 checking changesets
203 checking changesets
199 checking manifests
204 checking manifests
200 crosschecking files in changesets and manifests
205 crosschecking files in changesets and manifests
201 checking files
206 checking files
202 2 files, 4 changesets, 3 total revisions
207 2 files, 4 changesets, 3 total revisions
203 $ hg cat -r tip foo
208 $ hg cat -r tip foo
204 bleah
209 bleah
205 $ echo z > z
210 $ echo z > z
206 $ hg ci -A -m z z
211 $ hg ci -A -m z z
207 created new head
212 created new head
208
213
209 test pushkeys and bookmarks
214 test pushkeys and bookmarks
210
215
211 $ cd ../local
216 $ cd ../local
212 $ hg debugpushkey --config ui.ssh="python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote namespaces
217 $ hg debugpushkey --config ui.ssh="python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote namespaces
213 bookmarks
218 bookmarks
214 namespaces
219 namespaces
215 phases
220 phases
216 $ hg book foo -r 0
221 $ hg book foo -r 0
217 $ hg out -B
222 $ hg out -B
218 comparing with ssh://user@dummy/remote
223 comparing with ssh://user@dummy/remote
219 searching for changed bookmarks
224 searching for changed bookmarks
220 foo 1160648e36ce
225 foo 1160648e36ce
221 $ hg push -B foo
226 $ hg push -B foo
222 pushing to ssh://user@dummy/remote
227 pushing to ssh://user@dummy/remote
223 searching for changes
228 searching for changes
224 no changes found
229 no changes found
225 exporting bookmark foo
230 exporting bookmark foo
226 [1]
231 [1]
227 $ hg debugpushkey --config ui.ssh="python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote bookmarks
232 $ hg debugpushkey --config ui.ssh="python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote bookmarks
228 foo 1160648e36cec0054048a7edc4110c6f84fde594
233 foo 1160648e36cec0054048a7edc4110c6f84fde594
229 $ hg book -f foo
234 $ hg book -f foo
230 $ hg push --traceback
235 $ hg push --traceback
231 pushing to ssh://user@dummy/remote
236 pushing to ssh://user@dummy/remote
232 searching for changes
237 searching for changes
233 no changes found
238 no changes found
234 updating bookmark foo
239 updating bookmark foo
235 [1]
240 [1]
236 $ hg book -d foo
241 $ hg book -d foo
237 $ hg in -B
242 $ hg in -B
238 comparing with ssh://user@dummy/remote
243 comparing with ssh://user@dummy/remote
239 searching for changed bookmarks
244 searching for changed bookmarks
240 foo a28a9d1a809c
245 foo a28a9d1a809c
241 $ hg book -f -r 0 foo
246 $ hg book -f -r 0 foo
242 $ hg pull -B foo
247 $ hg pull -B foo
243 pulling from ssh://user@dummy/remote
248 pulling from ssh://user@dummy/remote
244 no changes found
249 no changes found
245 updating bookmark foo
250 updating bookmark foo
246 $ hg book -d foo
251 $ hg book -d foo
247 $ hg push -B foo
252 $ hg push -B foo
248 pushing to ssh://user@dummy/remote
253 pushing to ssh://user@dummy/remote
249 searching for changes
254 searching for changes
250 no changes found
255 no changes found
251 deleting remote bookmark foo
256 deleting remote bookmark foo
252 [1]
257 [1]
253
258
254 a bad, evil hook that prints to stdout
259 a bad, evil hook that prints to stdout
255
260
256 $ cat <<EOF > $TESTTMP/badhook
261 $ cat <<EOF > $TESTTMP/badhook
257 > import sys
262 > import sys
258 > sys.stdout.write("KABOOM\n")
263 > sys.stdout.write("KABOOM\n")
259 > EOF
264 > EOF
260
265
261 $ echo '[hooks]' >> ../remote/.hg/hgrc
266 $ echo '[hooks]' >> ../remote/.hg/hgrc
262 $ echo "changegroup.stdout = python $TESTTMP/badhook" >> ../remote/.hg/hgrc
267 $ echo "changegroup.stdout = python $TESTTMP/badhook" >> ../remote/.hg/hgrc
263 $ echo r > r
268 $ echo r > r
264 $ hg ci -A -m z r
269 $ hg ci -A -m z r
265
270
266 push should succeed even though it has an unexpected response
271 push should succeed even though it has an unexpected response
267
272
268 $ hg push
273 $ hg push
269 pushing to ssh://user@dummy/remote
274 pushing to ssh://user@dummy/remote
270 searching for changes
275 searching for changes
271 remote has heads on branch 'default' that are not known locally: 6c0482d977a3
276 remote has heads on branch 'default' that are not known locally: 6c0482d977a3
272 remote: adding changesets
277 remote: adding changesets
273 remote: adding manifests
278 remote: adding manifests
274 remote: adding file changes
279 remote: adding file changes
275 remote: added 1 changesets with 1 changes to 1 files
280 remote: added 1 changesets with 1 changes to 1 files
276 remote: KABOOM
281 remote: KABOOM
277 $ hg -R ../remote heads
282 $ hg -R ../remote heads
278 changeset: 5:1383141674ec
283 changeset: 5:1383141674ec
279 tag: tip
284 tag: tip
280 parent: 3:a28a9d1a809c
285 parent: 3:a28a9d1a809c
281 user: test
286 user: test
282 date: Thu Jan 01 00:00:00 1970 +0000
287 date: Thu Jan 01 00:00:00 1970 +0000
283 summary: z
288 summary: z
284
289
285 changeset: 4:6c0482d977a3
290 changeset: 4:6c0482d977a3
286 parent: 0:1160648e36ce
291 parent: 0:1160648e36ce
287 user: test
292 user: test
288 date: Thu Jan 01 00:00:00 1970 +0000
293 date: Thu Jan 01 00:00:00 1970 +0000
289 summary: z
294 summary: z
290
295
291
296
292 clone bookmarks
297 clone bookmarks
293
298
294 $ hg -R ../remote bookmark test
299 $ hg -R ../remote bookmark test
295 $ hg -R ../remote bookmarks
300 $ hg -R ../remote bookmarks
296 * test 4:6c0482d977a3
301 * test 4:6c0482d977a3
297 $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local-bookmarks
302 $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local-bookmarks
298 requesting all changes
303 requesting all changes
299 adding changesets
304 adding changesets
300 adding manifests
305 adding manifests
301 adding file changes
306 adding file changes
302 added 6 changesets with 5 changes to 4 files (+1 heads)
307 added 6 changesets with 5 changes to 4 files (+1 heads)
303 updating to branch default
308 updating to branch default
304 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
309 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
305 $ hg -R local-bookmarks bookmarks
310 $ hg -R local-bookmarks bookmarks
306 test 4:6c0482d977a3
311 test 4:6c0482d977a3
307
312
308 passwords in ssh urls are not supported
313 passwords in ssh urls are not supported
309 (we use a glob here because different Python versions give different
314 (we use a glob here because different Python versions give different
310 results here)
315 results here)
311
316
312 $ hg push ssh://user:erroneouspwd@dummy/remote
317 $ hg push ssh://user:erroneouspwd@dummy/remote
313 pushing to ssh://user:*@dummy/remote (glob)
318 pushing to ssh://user:*@dummy/remote (glob)
314 abort: password in URL not supported!
319 abort: password in URL not supported!
315 [255]
320 [255]
316
321
317 $ cd ..
322 $ cd ..
318
323
319 hide outer repo
324 hide outer repo
320 $ hg init
325 $ hg init
321
326
322 Test remote paths with spaces (issue2983):
327 Test remote paths with spaces (issue2983):
323
328
324 $ hg init --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
329 $ hg init --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
325 $ touch "$TESTTMP/a repo/test"
330 $ touch "$TESTTMP/a repo/test"
326 $ hg -R 'a repo' commit -A -m "test"
331 $ hg -R 'a repo' commit -A -m "test"
327 adding test
332 adding test
328 $ hg -R 'a repo' tag tag
333 $ hg -R 'a repo' tag tag
329 $ hg id --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
334 $ hg id --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
330 73649e48688a
335 73649e48688a
331
336
332 $ hg id --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo#noNoNO"
337 $ hg id --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo#noNoNO"
333 abort: unknown revision 'noNoNO'!
338 abort: unknown revision 'noNoNO'!
334 [255]
339 [255]
335
340
336 Test (non-)escaping of remote paths with spaces when cloning (issue3145):
341 Test (non-)escaping of remote paths with spaces when cloning (issue3145):
337
342
338 $ hg clone --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
343 $ hg clone --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
339 destination directory: a repo
344 destination directory: a repo
340 abort: destination 'a repo' is not empty
345 abort: destination 'a repo' is not empty
341 [255]
346 [255]
342
347
343 Test hg-ssh using a helper script that will restore PYTHONPATH (which might
348 Test hg-ssh using a helper script that will restore PYTHONPATH (which might
344 have been cleared by a hg.exe wrapper) and invoke hg-ssh with the right
349 have been cleared by a hg.exe wrapper) and invoke hg-ssh with the right
345 parameters:
350 parameters:
346
351
347 $ cat > ssh.sh << EOF
352 $ cat > ssh.sh << EOF
348 > userhost="\$1"
353 > userhost="\$1"
349 > SSH_ORIGINAL_COMMAND="\$2"
354 > SSH_ORIGINAL_COMMAND="\$2"
350 > export SSH_ORIGINAL_COMMAND
355 > export SSH_ORIGINAL_COMMAND
351 > PYTHONPATH="$PYTHONPATH"
356 > PYTHONPATH="$PYTHONPATH"
352 > export PYTHONPATH
357 > export PYTHONPATH
353 > python "$TESTDIR/../contrib/hg-ssh" "$TESTTMP/a repo"
358 > python "$TESTDIR/../contrib/hg-ssh" "$TESTTMP/a repo"
354 > EOF
359 > EOF
355
360
356 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a repo"
361 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a repo"
357 73649e48688a
362 73649e48688a
358
363
359 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a'repo"
364 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a'repo"
360 remote: Illegal repository "$TESTTMP/a'repo" (glob)
365 remote: Illegal repository "$TESTTMP/a'repo" (glob)
361 abort: no suitable response from remote hg!
366 abort: no suitable response from remote hg!
362 [255]
367 [255]
363
368
364 $ hg id --ssh "sh ssh.sh" --remotecmd hacking "ssh://user@dummy/a'repo"
369 $ hg id --ssh "sh ssh.sh" --remotecmd hacking "ssh://user@dummy/a'repo"
365 remote: Illegal command "hacking -R 'a'\''repo' serve --stdio"
370 remote: Illegal command "hacking -R 'a'\''repo' serve --stdio"
366 abort: no suitable response from remote hg!
371 abort: no suitable response from remote hg!
367 [255]
372 [255]
368
373
369 $ SSH_ORIGINAL_COMMAND="'hg' -R 'a'repo' serve --stdio" python "$TESTDIR/../contrib/hg-ssh"
374 $ SSH_ORIGINAL_COMMAND="'hg' -R 'a'repo' serve --stdio" python "$TESTDIR/../contrib/hg-ssh"
370 Illegal command "'hg' -R 'a'repo' serve --stdio": No closing quotation
375 Illegal command "'hg' -R 'a'repo' serve --stdio": No closing quotation
371 [255]
376 [255]
372
377
373 Test hg-ssh in read-only mode:
378 Test hg-ssh in read-only mode:
374
379
375 $ cat > ssh.sh << EOF
380 $ cat > ssh.sh << EOF
376 > userhost="\$1"
381 > userhost="\$1"
377 > SSH_ORIGINAL_COMMAND="\$2"
382 > SSH_ORIGINAL_COMMAND="\$2"
378 > export SSH_ORIGINAL_COMMAND
383 > export SSH_ORIGINAL_COMMAND
379 > PYTHONPATH="$PYTHONPATH"
384 > PYTHONPATH="$PYTHONPATH"
380 > export PYTHONPATH
385 > export PYTHONPATH
381 > python "$TESTDIR/../contrib/hg-ssh" --read-only "$TESTTMP/remote"
386 > python "$TESTDIR/../contrib/hg-ssh" --read-only "$TESTTMP/remote"
382 > EOF
387 > EOF
383
388
384 $ hg clone --ssh "sh ssh.sh" "ssh://user@dummy/$TESTTMP/remote" read-only-local
389 $ hg clone --ssh "sh ssh.sh" "ssh://user@dummy/$TESTTMP/remote" read-only-local
385 requesting all changes
390 requesting all changes
386 adding changesets
391 adding changesets
387 adding manifests
392 adding manifests
388 adding file changes
393 adding file changes
389 added 6 changesets with 5 changes to 4 files (+1 heads)
394 added 6 changesets with 5 changes to 4 files (+1 heads)
390 updating to branch default
395 updating to branch default
391 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
396 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
392
397
393 $ cd read-only-local
398 $ cd read-only-local
394 $ echo "baz" > bar
399 $ echo "baz" > bar
395 $ hg ci -A -m "unpushable commit" bar
400 $ hg ci -A -m "unpushable commit" bar
396 $ hg push --ssh "sh ../ssh.sh"
401 $ hg push --ssh "sh ../ssh.sh"
397 pushing to ssh://user@dummy/*/remote (glob)
402 pushing to ssh://user@dummy/*/remote (glob)
398 searching for changes
403 searching for changes
399 remote: Permission denied
404 remote: Permission denied
400 remote: pretxnopen.hg-ssh hook failed
405 remote: pretxnopen.hg-ssh hook failed
401 abort: push failed on remote
406 abort: push failed on remote
402 [255]
407 [255]
403
408
404 $ cd ..
409 $ cd ..
405
410
406 stderr from remote commands should be printed before stdout from local code (issue4336)
411 stderr from remote commands should be printed before stdout from local code (issue4336)
407
412
408 $ hg clone remote stderr-ordering
413 $ hg clone remote stderr-ordering
409 updating to branch default
414 updating to branch default
410 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
415 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
411 $ cd stderr-ordering
416 $ cd stderr-ordering
412 $ cat >> localwrite.py << EOF
417 $ cat >> localwrite.py << EOF
413 > from mercurial import exchange, extensions
418 > from mercurial import exchange, extensions
414 >
419 >
415 > def wrappedpush(orig, repo, *args, **kwargs):
420 > def wrappedpush(orig, repo, *args, **kwargs):
416 > res = orig(repo, *args, **kwargs)
421 > res = orig(repo, *args, **kwargs)
417 > repo.ui.write('local stdout\n')
422 > repo.ui.write('local stdout\n')
418 > return res
423 > return res
419 >
424 >
420 > def extsetup(ui):
425 > def extsetup(ui):
421 > extensions.wrapfunction(exchange, 'push', wrappedpush)
426 > extensions.wrapfunction(exchange, 'push', wrappedpush)
422 > EOF
427 > EOF
423
428
424 $ cat >> .hg/hgrc << EOF
429 $ cat >> .hg/hgrc << EOF
425 > [paths]
430 > [paths]
426 > default-push = ssh://user@dummy/remote
431 > default-push = ssh://user@dummy/remote
427 > [ui]
432 > [ui]
428 > ssh = python "$TESTDIR/dummyssh"
433 > ssh = python "$TESTDIR/dummyssh"
429 > [extensions]
434 > [extensions]
430 > localwrite = localwrite.py
435 > localwrite = localwrite.py
431 > EOF
436 > EOF
432
437
433 $ echo localwrite > foo
438 $ echo localwrite > foo
434 $ hg commit -m 'testing localwrite'
439 $ hg commit -m 'testing localwrite'
435 $ hg push
440 $ hg push
436 pushing to ssh://user@dummy/remote
441 pushing to ssh://user@dummy/remote
437 searching for changes
442 searching for changes
438 remote: adding changesets
443 remote: adding changesets
439 remote: adding manifests
444 remote: adding manifests
440 remote: adding file changes
445 remote: adding file changes
441 remote: added 1 changesets with 1 changes to 1 files
446 remote: added 1 changesets with 1 changes to 1 files
442 remote: KABOOM
447 remote: KABOOM
443 local stdout
448 local stdout
444
449
445 debug output
450 debug output
446
451
447 $ hg pull --debug ssh://user@dummy/remote
452 $ hg pull --debug ssh://user@dummy/remote
448 pulling from ssh://user@dummy/remote
453 pulling from ssh://user@dummy/remote
449 running python ".*/dummyssh" user@dummy ('|")hg -R remote serve --stdio('|") (re)
454 running python ".*/dummyssh" user@dummy ('|")hg -R remote serve --stdio('|") (re)
450 sending hello command
455 sending hello command
451 sending between command
456 sending between command
452 remote: 345
457 remote: 371
453 remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch stream bundle2=HG20%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024
458 remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 bundle2=HG20%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024
454 remote: 1
459 remote: 1
455 query 1; heads
460 query 1; heads
456 sending batch command
461 sending batch command
457 searching for changes
462 searching for changes
458 all remote heads known locally
463 all remote heads known locally
459 no changes found
464 no changes found
460 sending getbundle command
465 sending getbundle command
461 bundle2-input-bundle: with-transaction
466 bundle2-input-bundle: with-transaction
462 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
467 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
463 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
468 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
464 bundle2-input-part: total payload size 45
469 bundle2-input-part: total payload size 45
465 bundle2-input-bundle: 1 parts total
470 bundle2-input-bundle: 1 parts total
466 checking for updated bookmarks
471 checking for updated bookmarks
467 preparing listkeys for "phases"
472 preparing listkeys for "phases"
468 sending listkeys command
473 sending listkeys command
469 received listkey for "phases": 15 bytes
474 received listkey for "phases": 15 bytes
470
475
471 $ cd ..
476 $ cd ..
472
477
473 $ cat dummylog
478 $ cat dummylog
474 Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio
479 Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio
475 Got arguments 1:user@dummy 2:hg -R $TESTTMP/nonexistent serve --stdio
480 Got arguments 1:user@dummy 2:hg -R $TESTTMP/nonexistent serve --stdio
476 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
481 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
477 Got arguments 1:user@dummy 2:hg -R local-stream serve --stdio
482 Got arguments 1:user@dummy 2:hg -R local-stream serve --stdio
478 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
483 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
479 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
484 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
480 Got arguments 1:user@dummy 2:hg -R doesnotexist serve --stdio
485 Got arguments 1:user@dummy 2:hg -R doesnotexist serve --stdio
481 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
486 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
482 Got arguments 1:user@dummy 2:hg -R local serve --stdio
487 Got arguments 1:user@dummy 2:hg -R local serve --stdio
483 Got arguments 1:user@dummy 2:hg -R $TESTTMP/local serve --stdio
488 Got arguments 1:user@dummy 2:hg -R $TESTTMP/local serve --stdio
484 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
489 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
485 changegroup-in-remote hook: HG_BUNDLE2=1 HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:ssh:127.0.0.1 (glob)
490 changegroup-in-remote hook: HG_BUNDLE2=1 HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:ssh:127.0.0.1 (glob)
486 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
491 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
487 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
492 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
488 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
493 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
489 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
494 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
490 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
495 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
491 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
496 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
492 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
497 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
493 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
498 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
494 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
499 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
495 changegroup-in-remote hook: HG_BUNDLE2=1 HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:ssh:127.0.0.1 (glob)
500 changegroup-in-remote hook: HG_BUNDLE2=1 HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:ssh:127.0.0.1 (glob)
496 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
501 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
497 Got arguments 1:user@dummy 2:hg init 'a repo'
502 Got arguments 1:user@dummy 2:hg init 'a repo'
498 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
503 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
499 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
504 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
500 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
505 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
501 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
506 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
502 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
507 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
503 changegroup-in-remote hook: HG_BUNDLE2=1 HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:ssh:127.0.0.1 (glob)
508 changegroup-in-remote hook: HG_BUNDLE2=1 HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:ssh:127.0.0.1 (glob)
504 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
509 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
505
510
506 remote hook failure is attributed to remote
511 remote hook failure is attributed to remote
507
512
508 $ cat > $TESTTMP/failhook << EOF
513 $ cat > $TESTTMP/failhook << EOF
509 > def hook(ui, repo, **kwargs):
514 > def hook(ui, repo, **kwargs):
510 > ui.write('hook failure!\n')
515 > ui.write('hook failure!\n')
511 > ui.flush()
516 > ui.flush()
512 > return 1
517 > return 1
513 > EOF
518 > EOF
514
519
515 $ echo "pretxnchangegroup.fail = python:$TESTTMP/failhook:hook" >> remote/.hg/hgrc
520 $ echo "pretxnchangegroup.fail = python:$TESTTMP/failhook:hook" >> remote/.hg/hgrc
516
521
517 $ hg -q --config ui.ssh="python '$TESTDIR/dummyssh'" clone ssh://user@dummy/remote hookout
522 $ hg -q --config ui.ssh="python '$TESTDIR/dummyssh'" clone ssh://user@dummy/remote hookout
518 $ cd hookout
523 $ cd hookout
519 $ touch hookfailure
524 $ touch hookfailure
520 $ hg -q commit -A -m 'remote hook failure'
525 $ hg -q commit -A -m 'remote hook failure'
521 $ hg --config ui.ssh="python '$TESTDIR/dummyssh'" push
526 $ hg --config ui.ssh="python '$TESTDIR/dummyssh'" push
522 pushing to ssh://user@dummy/remote
527 pushing to ssh://user@dummy/remote
523 searching for changes
528 searching for changes
524 remote: adding changesets
529 remote: adding changesets
525 remote: adding manifests
530 remote: adding manifests
526 remote: adding file changes
531 remote: adding file changes
527 remote: added 1 changesets with 1 changes to 1 files
532 remote: added 1 changesets with 1 changes to 1 files
528 remote: hook failure!
533 remote: hook failure!
529 remote: transaction abort!
534 remote: transaction abort!
530 remote: rollback completed
535 remote: rollback completed
531 remote: pretxnchangegroup.fail hook failed
536 remote: pretxnchangegroup.fail hook failed
532 abort: push failed on remote
537 abort: push failed on remote
533 [255]
538 [255]
534
539
General Comments 0
You need to be logged in to leave comments. Login now