Debian Codegraph @

tests/test-ssh.t

raw
1 This test tries to exercise the ssh functionality with a dummy script
2
3 creating 'remote' repo
4
5 $ hg init remote
6 $ cd remote
7 $ echo this > foo
8 $ echo this > fooO
9 $ hg ci -A -m "init" foo fooO
10
11 insert a closed branch (issue4428)
12
13 $ hg up null
14 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
15 $ hg branch closed
16 marked working directory as branch closed
17 (branches are permanent and global, did you want a bookmark?)
18 $ hg ci -mc0
19 $ hg ci --close-branch -mc1
20 $ hg up -q default
21
22 configure for serving
23
24 $ cat <<EOF > .hg/hgrc
25 > [server]
26 > uncompressed = True
27 >
28 > [hooks]
29 > changegroup = sh -c "printenv.py --line changegroup-in-remote 0 ../dummylog"
30 > EOF
31 $ cd $TESTTMP
32
33 repo not found error
34
35 $ hg clone ssh://user@dummy/nonexistent local
36 remote: abort: repository nonexistent not found
37 abort: no suitable response from remote hg
38 [255]
39 $ hg clone -q ssh://user@dummy/nonexistent local
40 remote: abort: repository nonexistent not found
41 abort: no suitable response from remote hg
42 [255]
43
44 non-existent absolute path
45
46 $ hg clone ssh://user@dummy/`pwd`/nonexistent local
47 remote: abort: repository $TESTTMP/nonexistent not found
48 abort: no suitable response from remote hg
49 [255]
50
51 clone remote via stream
52
53 $ hg clone --stream ssh://user@dummy/remote local-stream
54 streaming all changes
55 * files to transfer, * bytes of data (glob)
56 stream-cloned * bytes in * seconds (* */sec) (glob)
57 updating to branch default
58 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
59 $ cd local-stream
60 $ hg verify -q
61 $ hg branches
62 default 0:1160648e36ce
63 $ cd $TESTTMP
64
65 clone bookmarks via stream
66
67 $ hg -R local-stream book mybook
68 $ hg clone --stream ssh://user@dummy/local-stream stream2
69 streaming all changes
70 * files to transfer, * of data (glob)
71 stream-cloned * files / * in * seconds (*) (glob)
72 updating to branch default
73 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
74 $ cd stream2
75 $ hg book
76 mybook 0:1160648e36ce
77 $ cd $TESTTMP
78 $ rm -rf local-stream stream2
79
80 clone remote via pull
81
82 $ hg clone ssh://user@dummy/remote local
83 requesting all changes
84 adding changesets
85 adding manifests
86 adding file changes
87 added 3 changesets with 2 changes to 2 files
88 new changesets 1160648e36ce:ad076bfb429d
89 updating to branch default
90 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
91
92 verify
93
94 $ cd local
95 $ hg verify -q
96 $ cat >> .hg/hgrc <<EOF
97 > [hooks]
98 > changegroup = sh -c "printenv.py changegroup-in-local 0 ../dummylog"
99 > EOF
100
101 empty default pull
102
103 $ hg paths
104 default = ssh://user@dummy/remote
105 $ hg pull
106 pulling from ssh://user@dummy/remote
107 searching for changes
108 no changes found
109
110 pull from wrong ssh URL
111
112 $ hg pull ssh://user@dummy/doesnotexist
113 pulling from ssh://user@dummy/doesnotexist
114 remote: abort: repository doesnotexist not found
115 abort: no suitable response from remote hg
116 [255]
117
118 local change
119
120 $ echo bleah > foo
121 $ hg ci -m "add"
122
123 updating rc
124
125 $ echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc
126
127 find outgoing
128
129 $ hg out ssh://user@dummy/remote
130 comparing with ssh://user@dummy/remote
131 searching for changes
132 changeset: 3:a28a9d1a809c
133 tag: tip
134 parent: 0:1160648e36ce
135 user: test
136 date: Thu Jan 01 00:00:00 1970 +0000
137 summary: add
138
139
140 find incoming on the remote side
141
142 $ hg incoming -R ../remote ssh://user@dummy/local
143 comparing with ssh://user@dummy/local
144 searching for changes
145 changeset: 3:a28a9d1a809c
146 tag: tip
147 parent: 0:1160648e36ce
148 user: test
149 date: Thu Jan 01 00:00:00 1970 +0000
150 summary: add
151
152
153 find incoming on the remote side (using absolute path)
154
155 $ hg incoming -R ../remote "ssh://user@dummy/`pwd`"
156 comparing with ssh://user@dummy/$TESTTMP/local
157 searching for changes
158 changeset: 3:a28a9d1a809c
159 tag: tip
160 parent: 0:1160648e36ce
161 user: test
162 date: Thu Jan 01 00:00:00 1970 +0000
163 summary: add
164
165
166 push
167
168 $ hg push
169 pushing to ssh://user@dummy/remote
170 searching for changes
171 remote: adding changesets
172 remote: adding manifests
173 remote: adding file changes
174 remote: added 1 changesets with 1 changes to 1 files
175 $ cd $TESTTMP/remote
176
177 check remote tip
178
179 $ hg tip
180 changeset: 3:a28a9d1a809c
181 tag: tip
182 parent: 0:1160648e36ce
183 user: test
184 date: Thu Jan 01 00:00:00 1970 +0000
185 summary: add
186
187 $ hg verify -q
188 $ hg cat -r tip foo
189 bleah
190 $ echo z > z
191 $ hg ci -A -m z z
192 created new head
193
194 test pushkeys and bookmarks
195
196 $ cd $TESTTMP/local
197 $ hg debugpushkey ssh://user@dummy/remote namespaces
198 bookmarks
199 namespaces
200 phases
201 $ hg book foo -r 0
202 $ hg out -B --config paths.default=bogus://invalid --config paths.default:pushurl=`hg paths default`
203 comparing with ssh://user@dummy/remote
204 searching for changed bookmarks
205 foo 1160648e36ce
206 $ hg push -B foo
207 pushing to ssh://user@dummy/remote
208 searching for changes
209 no changes found
210 exporting bookmark foo
211 [1]
212 $ hg debugpushkey ssh://user@dummy/remote bookmarks
213 foo 1160648e36cec0054048a7edc4110c6f84fde594
214 $ hg book -f foo
215 $ hg push --traceback
216 pushing to ssh://user@dummy/remote
217 searching for changes
218 no changes found
219 updating bookmark foo
220 [1]
221 $ hg book -d foo
222 $ hg in -B
223 comparing with ssh://user@dummy/remote
224 searching for changed bookmarks
225 foo a28a9d1a809c
226 $ hg book -f -r 0 foo
227 $ hg pull -B foo
228 pulling from ssh://user@dummy/remote
229 no changes found
230 updating bookmark foo
231 $ hg book -d foo
232 $ hg push -B foo
233 pushing to ssh://user@dummy/remote
234 searching for changes
235 no changes found
236 deleting remote bookmark foo
237 [1]
238
239 a bad, evil hook that prints to stdout
240
241 $ cat <<EOF > $TESTTMP/badhook
242 > import sys
243 > sys.stdout.write("KABOOM\n")
244 > sys.stdout.flush()
245 > EOF
246
247 $ cat <<EOF > $TESTTMP/badpyhook.py
248 > import sys
249 > def hook(ui, repo, hooktype, **kwargs):
250 > sys.stdout.write("KABOOM IN PROCESS\n")
251 > sys.stdout.flush()
252 > EOF
253
254 $ cat <<EOF >> ../remote/.hg/hgrc
255 > [hooks]
256 > changegroup.stdout = "$PYTHON" $TESTTMP/badhook
257 > changegroup.pystdout = python:$TESTTMP/badpyhook.py:hook
258 > EOF
259 $ echo r > r
260 $ hg ci -A -m z r
261
262 push should succeed even though it has an unexpected response
263
264 $ hg push
265 pushing to ssh://user@dummy/remote
266 searching for changes
267 remote has heads on branch 'default' that are not known locally: 6c0482d977a3
268 remote: adding changesets
269 remote: adding manifests
270 remote: adding file changes
271 remote: added 1 changesets with 1 changes to 1 files
272 remote: KABOOM
273 remote: KABOOM IN PROCESS
274 $ hg -R ../remote heads
275 changeset: 5:1383141674ec
276 tag: tip
277 parent: 3:a28a9d1a809c
278 user: test
279 date: Thu Jan 01 00:00:00 1970 +0000
280 summary: z
281
282 changeset: 4:6c0482d977a3
283 parent: 0:1160648e36ce
284 user: test
285 date: Thu Jan 01 00:00:00 1970 +0000
286 summary: z
287
288
289 #if chg
290
291 try again with remote chg, which should succeed as well
292
293 $ hg rollback -R ../remote
294 repository tip rolled back to revision 4 (undo serve)
295
296 $ hg push --config ui.remotecmd=chg
297 pushing to ssh://user@dummy/remote
298 searching for changes
299 remote has heads on branch 'default' that are not known locally: 6c0482d977a3
300 remote: adding changesets
301 remote: adding manifests
302 remote: adding file changes
303 remote: added 1 changesets with 1 changes to 1 files
304 remote: KABOOM
305 remote: KABOOM IN PROCESS
306
307 #endif
308
309 clone bookmarks
310
311 $ hg -R ../remote bookmark test
312 $ hg -R ../remote bookmarks
313 * test 4:6c0482d977a3
314 $ hg clone ssh://user@dummy/remote local-bookmarks
315 requesting all changes
316 adding changesets
317 adding manifests
318 adding file changes
319 added 6 changesets with 5 changes to 4 files (+1 heads)
320 new changesets 1160648e36ce:1383141674ec
321 updating to branch default
322 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
323 $ hg -R local-bookmarks bookmarks
324 test 4:6c0482d977a3
325
326 passwords in ssh urls are not supported
327 (we use a glob here because different Python versions give different
328 results here)
329
330 $ hg push ssh://user:erroneouspwd@dummy/remote
331 pushing to ssh://user:*@dummy/remote (glob)
332 abort: password in URL not supported
333 [255]
334
335 $ cd $TESTTMP
336
337 hide outer repo
338 $ hg init
339
340 Test remote paths with spaces (issue2983):
341
342 $ hg init "ssh://user@dummy/a repo"
343 $ touch "$TESTTMP/a repo/test"
344 $ hg -R 'a repo' commit -A -m "test"
345 adding test
346 $ hg -R 'a repo' tag tag
347 $ hg id "ssh://user@dummy/a repo"
348 73649e48688a
349
350 $ hg id "ssh://user@dummy/a repo#noNoNO"
351 abort: unknown revision 'noNoNO'
352 [255]
353
354 Test (non-)escaping of remote paths with spaces when cloning (issue3145):
355
356 $ hg clone "ssh://user@dummy/a repo"
357 destination directory: a repo
358 abort: destination 'a repo' is not empty
359 [10]
360
361 #if no-rhg
362 Make sure hg is really paranoid in serve --stdio mode. It used to be
363 possible to get a debugger REPL by specifying a repo named --debugger.
364 $ hg -R --debugger serve --stdio
365 abort: potentially unsafe serve --stdio invocation: ['-R', '--debugger', 'serve', '--stdio']
366 [255]
367 $ hg -R --config=ui.debugger=yes serve --stdio
368 abort: potentially unsafe serve --stdio invocation: ['-R', '--config=ui.debugger=yes', 'serve', '--stdio']
369 [255]
370 Abbreviations of 'serve' also don't work, to avoid shenanigans.
371 $ hg -R narf serv --stdio
372 abort: potentially unsafe serve --stdio invocation: ['-R', 'narf', 'serv', '--stdio']
373 [255]
374 #else
375 rhg aborts early on -R without a repository at that path
376 $ hg -R --debugger serve --stdio
377 abort: potentially unsafe serve --stdio invocation: ['-R', '--debugger', 'serve', '--stdio'] (missing-correct-output !)
378 abort: repository --debugger not found (known-bad-output !)
379 [255]
380 $ hg -R --config=ui.debugger=yes serve --stdio
381 abort: potentially unsafe serve --stdio invocation: ['-R', '--config=ui.debugger=yes', 'serve', '--stdio'] (missing-correct-output !)
382 abort: repository --config=ui.debugger=yes not found (known-bad-output !)
383 [255]
384 $ hg -R narf serv --stdio
385 abort: potentially unsafe serve --stdio invocation: ['-R', 'narf', 'serv', '--stdio'] (missing-correct-output !)
386 abort: repository narf not found (known-bad-output !)
387 [255]
388 If the repo does exist, rhg finds an unsupported command and falls back to Python
389 which still does the right thing
390 $ hg init narf
391 $ hg -R narf serv --stdio
392 abort: potentially unsafe serve --stdio invocation: ['-R', 'narf', 'serv', '--stdio']
393 [255]
394 #endif
395
396 Test hg-ssh using a helper script that will restore PYTHONPATH (which might
397 have been cleared by a hg.exe wrapper) and invoke hg-ssh with the right
398 parameters:
399
400 $ cat > ssh.sh << EOF
401 > userhost="\$1"
402 > SSH_ORIGINAL_COMMAND="\$2"
403 > export SSH_ORIGINAL_COMMAND
404 > PYTHONPATH="$PYTHONPATH"
405 > export PYTHONPATH
406 > "$PYTHON" "$TESTDIR/../contrib/hg-ssh" "$TESTTMP/a repo"
407 > EOF
408
409 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a repo"
410 73649e48688a
411
412 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a'repo"
413 remote: Illegal repository "$TESTTMP/a'repo"
414 abort: no suitable response from remote hg
415 [255]
416
417 $ hg id --ssh "sh ssh.sh" --remotecmd hacking "ssh://user@dummy/a'repo"
418 remote: Illegal command "hacking -R 'a'\''repo' serve --stdio"
419 abort: no suitable response from remote hg
420 [255]
421
422 $ SSH_ORIGINAL_COMMAND="'hg' -R 'a'repo' serve --stdio" "$PYTHON" "$TESTDIR/../contrib/hg-ssh"
423 Illegal command "'hg' -R 'a'repo' serve --stdio": No closing quotation
424 [255]
425
426 Test hg-ssh in read-only mode:
427
428 $ cat > ssh.sh << EOF
429 > userhost="\$1"
430 > SSH_ORIGINAL_COMMAND="\$2"
431 > export SSH_ORIGINAL_COMMAND
432 > PYTHONPATH="$PYTHONPATH"
433 > export PYTHONPATH
434 > "$PYTHON" "$TESTDIR/../contrib/hg-ssh" --read-only "$TESTTMP/remote"
435 > EOF
436
437 $ hg clone --ssh "sh ssh.sh" "ssh://user@dummy/$TESTTMP/remote" read-only-local
438 requesting all changes
439 adding changesets
440 adding manifests
441 adding file changes
442 added 6 changesets with 5 changes to 4 files (+1 heads)
443 new changesets 1160648e36ce:1383141674ec
444 updating to branch default
445 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
446
447 $ cd read-only-local
448 $ echo "baz" > bar
449 $ hg ci -A -m "unpushable commit" bar
450 $ hg push --ssh "sh ../ssh.sh"
451 pushing to ssh://user@dummy/*/remote (glob)
452 searching for changes
453 remote: $EACCES$
454 remote: pretxnopen.hg-ssh hook failed
455 abort: push failed on remote
456 [100]
457
458 $ cd $TESTTMP
459
460 stderr from remote commands should be printed before stdout from local code (issue4336)
461
462 $ hg clone remote stderr-ordering
463 updating to branch default
464 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
465 $ cd stderr-ordering
466 $ cat >> localwrite.py << EOF
467 > from mercurial import exchange, extensions
468 >
469 > def wrappedpush(orig, repo, *args, **kwargs):
470 > res = orig(repo, *args, **kwargs)
471 > repo.ui.write(b'local stdout\n')
472 > repo.ui.flush()
473 > return res
474 >
475 > def extsetup(ui):
476 > extensions.wrapfunction(exchange, 'push', wrappedpush)
477 > EOF
478
479 $ cat >> .hg/hgrc << EOF
480 > [paths]
481 > default-push = ssh://user@dummy/remote
482 > [extensions]
483 > localwrite = localwrite.py
484 > EOF
485
486 $ echo localwrite > foo
487 $ hg commit -m 'testing localwrite'
488 $ hg push
489 pushing to ssh://user@dummy/remote
490 searching for changes
491 remote: adding changesets
492 remote: adding manifests
493 remote: adding file changes
494 remote: added 1 changesets with 1 changes to 1 files
495 remote: KABOOM
496 remote: KABOOM IN PROCESS
497 local stdout
498
499 debug output
500
501 $ hg pull --debug ssh://user@dummy/remote --config devel.debug.peer-request=yes
502 pulling from ssh://user@dummy/remote
503 running .* ".*[/\\]dummyssh" ['"]user@dummy['"] ['"]hg -R remote serve --stdio['"] (re)
504 devel-peer-request: hello+between
505 devel-peer-request: pairs: 81 bytes
506 sending hello command
507 sending between command
508 remote: \d+ (re)
509 remote: capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (re)
510 remote: 1
511 devel-peer-request: protocaps
512 devel-peer-request: caps: * bytes (glob)
513 sending protocaps command
514 query 1; heads
515 devel-peer-request: batched-content
516 devel-peer-request: - heads (0 arguments)
517 devel-peer-request: - known (1 arguments)
518 devel-peer-request: batch
519 devel-peer-request: cmds: 141 bytes
520 sending batch command
521 searching for changes
522 all remote heads known locally
523 no changes found
524 devel-peer-request: getbundle
525 devel-peer-request: bookmarks: 1 bytes
526 devel-peer-request: bundlecaps: 316 bytes (zstd !)
527 devel-peer-request: bundlecaps: 309 bytes (no-zstd !)
528 devel-peer-request: cg: 1 bytes
529 devel-peer-request: common: 122 bytes
530 devel-peer-request: heads: 122 bytes
531 devel-peer-request: listkeys: 9 bytes
532 devel-peer-request: phases: 1 bytes
533 sending getbundle command
534 bundle2-input-bundle: with-transaction
535 bundle2-input-part: "bookmarks" supported
536 bundle2-input-part: total payload size 26
537 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
538 bundle2-input-part: total payload size 45
539 bundle2-input-part: "phase-heads" supported
540 bundle2-input-part: total payload size 72
541 bundle2-input-bundle: 3 parts total
542 checking for updated bookmarks
543
544 $ cd $TESTTMP
545
546 $ cat dummylog
547 Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio
548 Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio
549 Got arguments 1:user@dummy 2:hg -R $TESTTMP/nonexistent serve --stdio
550 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
551 Got arguments 1:user@dummy 2:hg -R local-stream serve --stdio
552 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
553 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
554 Got arguments 1:user@dummy 2:hg -R doesnotexist serve --stdio
555 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
556 Got arguments 1:user@dummy 2:hg -R local serve --stdio
557 Got arguments 1:user@dummy 2:hg -R $TESTTMP/local serve --stdio
558 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
559 changegroup-in-remote hook: HG_BUNDLE2=1
560 HG_HOOKNAME=changegroup
561 HG_HOOKTYPE=changegroup
562 HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60
563 HG_NODE_LAST=a28a9d1a809cab7d4e2fde4bee738a9ede948b60
564 HG_SOURCE=serve
565 HG_TXNID=TXN:$ID$
566 HG_TXNNAME=serve
567 HG_URL=remote:ssh:$LOCALIP
568
569 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
570 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
571 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
572 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
573 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
574 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
575 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
576 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
577 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
578 changegroup-in-remote hook: HG_BUNDLE2=1
579 HG_HOOKNAME=changegroup
580 HG_HOOKTYPE=changegroup
581 HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6
582 HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6
583 HG_SOURCE=serve
584 HG_TXNID=TXN:$ID$
585 HG_TXNNAME=serve
586 HG_URL=remote:ssh:$LOCALIP
587
588 Got arguments 1:user@dummy 2:chg -R remote serve --stdio (chg !)
589 changegroup-in-remote hook: HG_BUNDLE2=1 (chg !)
590 HG_HOOKNAME=changegroup (chg !)
591 HG_HOOKTYPE=changegroup (chg !)
592 HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6 (chg !)
593 HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6 (chg !)
594 HG_SOURCE=serve (chg !)
595 HG_TXNID=TXN:$ID$ (chg !)
596 HG_TXNNAME=serve (chg !)
597 HG_URL=remote:ssh:$LOCALIP (chg !)
598 (chg !)
599 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
600 Got arguments 1:user@dummy 2:hg init 'a repo'
601 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
602 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
603 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
604 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
605 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
606 changegroup-in-remote hook: HG_BUNDLE2=1
607 HG_HOOKNAME=changegroup
608 HG_HOOKTYPE=changegroup
609 HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8
610 HG_NODE_LAST=65c38f4125f9602c8db4af56530cc221d93b8ef8
611 HG_SOURCE=serve
612 HG_TXNID=TXN:$ID$
613 HG_TXNNAME=serve
614 HG_URL=remote:ssh:$LOCALIP
615
616 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
617
618
619 remote hook failure is attributed to remote
620
621 $ cat > $TESTTMP/failhook << EOF
622 > def hook(ui, repo, **kwargs):
623 > ui.write(b'hook failure!\n')
624 > ui.flush()
625 > return 1
626 > EOF
627
628 $ echo "pretxnchangegroup.fail = python:$TESTTMP/failhook:hook" >> remote/.hg/hgrc
629
630 $ hg -q clone ssh://user@dummy/remote hookout
631 $ cd hookout
632 $ touch hookfailure
633 $ hg -q commit -A -m 'remote hook failure'
634 $ hg push
635 pushing to ssh://user@dummy/remote
636 searching for changes
637 remote: adding changesets
638 remote: adding manifests
639 remote: adding file changes
640 remote: hook failure!
641 remote: transaction abort!
642 remote: rollback completed
643 remote: pretxnchangegroup.fail hook failed
644 abort: push failed on remote
645 [100]
646
647 abort during pull is properly reported as such
648
649 $ echo morefoo >> ../remote/foo
650 $ hg -R ../remote commit --message "more foo to be pulled"
651 $ cat >> ../remote/.hg/hgrc << EOF
652 > [extensions]
653 > crash = ${TESTDIR}/crashgetbundler.py
654 > EOF
655 $ hg pull
656 pulling from ssh://user@dummy/remote
657 searching for changes
658 remote: abort: this is an exercise
659 abort: pull failed on remote
660 [100]
661
662 abort with no error hint when there is a ssh problem when pulling
663
664 $ hg pull ssh://brokenrepository
665 pulling from ssh://brokenrepository/
666 abort: no suitable response from remote hg
667 [255]
668
669 abort with configured error hint when there is a ssh problem when pulling
670
671 $ hg pull ssh://brokenrepository \
672 > --config ui.ssherrorhint="Please see http://company/internalwiki/ssh.html"
673 pulling from ssh://brokenrepository/
674 abort: no suitable response from remote hg
675 (Please see http://company/internalwiki/ssh.html)
676 [255]
677
678 test that custom environment is passed down to ssh executable
679 $ cat >>dumpenv <<EOF
680 > #! /bin/sh
681 > echo \$VAR >&2
682 > EOF
683 $ chmod +x dumpenv
684 $ hg pull ssh://something --config ui.ssh="sh dumpenv"
685 pulling from ssh://something/
686 remote:
687 abort: no suitable response from remote hg
688 [255]
689 $ hg pull ssh://something --config ui.ssh="sh dumpenv" --config sshenv.VAR=17
690 pulling from ssh://something/
691 remote: 17
692 abort: no suitable response from remote hg
693 [255]
694