comparison tests/test-ssh.t @ 33335:72f051f9a7d8

tests: quote $PYTHON for Windows When unquoted, MSYS sees the colon between the drive letter and path as a Unix path separator and unhelpfully splits on it, feeding only the drive letter as the command. Much chaos ensues. I vaguely remember trying to get the test runner to use /letter/path/to/exe syntax the last time this happened, without success. I doubt a check-code rule would work, since sometimes it is quoted, and sometimes the quotes are escaped.
author Matt Harbison <matt_harbison@yahoo.com>
date Fri, 07 Jul 2017 01:05:20 -0400
parents 2428e8ec0793
children 8cb9e921ef8c
comparison
equal deleted inserted replaced
33334:20f533a92eda 33335:72f051f9a7d8
36 > EOF 36 > EOF
37 $ cd .. 37 $ cd ..
38 38
39 repo not found error 39 repo not found error
40 40
41 $ hg clone -e "$PYTHON \"$TESTDIR/dummyssh\"" ssh://user@dummy/nonexistent local 41 $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/nonexistent local
42 remote: abort: repository nonexistent not found! 42 remote: abort: repository nonexistent not found!
43 abort: no suitable response from remote hg! 43 abort: no suitable response from remote hg!
44 [255] 44 [255]
45 45
46 non-existent absolute path 46 non-existent absolute path
47 47
48 $ 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
49 remote: abort: repository $TESTTMP/nonexistent not found! 49 remote: abort: repository $TESTTMP/nonexistent not found!
50 abort: no suitable response from remote hg! 50 abort: no suitable response from remote hg!
51 [255] 51 [255]
52 52
53 clone remote via stream 53 clone remote via stream
54 54
55 $ 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
56 streaming all changes 56 streaming all changes
57 4 files to transfer, 602 bytes of data 57 4 files to transfer, 602 bytes of data
58 transferred 602 bytes in * seconds (*) (glob) 58 transferred 602 bytes in * seconds (*) (glob)
59 searching for changes 59 searching for changes
60 no changes found 60 no changes found
72 $ cd .. 72 $ cd ..
73 73
74 clone bookmarks via stream 74 clone bookmarks via stream
75 75
76 $ hg -R local-stream book mybook 76 $ hg -R local-stream book mybook
77 $ 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
78 streaming all changes 78 streaming all changes
79 4 files to transfer, 602 bytes of data 79 4 files to transfer, 602 bytes of data
80 transferred 602 bytes in * seconds (*) (glob) 80 transferred 602 bytes in * seconds (*) (glob)
81 searching for changes 81 searching for changes
82 no changes found 82 no changes found
88 $ cd .. 88 $ cd ..
89 $ rm -rf local-stream stream2 89 $ rm -rf local-stream stream2
90 90
91 clone remote via pull 91 clone remote via pull
92 92
93 $ hg clone -e "$PYTHON \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local 93 $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local
94 requesting all changes 94 requesting all changes
95 adding changesets 95 adding changesets
96 adding manifests 96 adding manifests
97 adding file changes 97 adding file changes
98 added 3 changesets with 2 changes to 2 files 98 added 3 changesets with 2 changes to 2 files
115 115
116 empty default pull 116 empty default pull
117 117
118 $ hg paths 118 $ hg paths
119 default = ssh://user@dummy/remote 119 default = ssh://user@dummy/remote
120 $ hg pull -e "$PYTHON \"$TESTDIR/dummyssh\"" 120 $ hg pull -e "\"$PYTHON\" \"$TESTDIR/dummyssh\""
121 pulling from ssh://user@dummy/remote 121 pulling from ssh://user@dummy/remote
122 searching for changes 122 searching for changes
123 no changes found 123 no changes found
124 124
125 pull from wrong ssh URL 125 pull from wrong ssh URL
126 126
127 $ hg pull -e "$PYTHON \"$TESTDIR/dummyssh\"" ssh://user@dummy/doesnotexist 127 $ hg pull -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/doesnotexist
128 pulling from ssh://user@dummy/doesnotexist 128 pulling from ssh://user@dummy/doesnotexist
129 remote: abort: repository doesnotexist not found! 129 remote: abort: repository doesnotexist not found!
130 abort: no suitable response from remote hg! 130 abort: no suitable response from remote hg!
131 [255] 131 [255]
132 132
137 137
138 updating rc 138 updating rc
139 139
140 $ echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc 140 $ echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc
141 $ echo "[ui]" >> .hg/hgrc 141 $ echo "[ui]" >> .hg/hgrc
142 $ echo "ssh = $PYTHON \"$TESTDIR/dummyssh\"" >> .hg/hgrc 142 $ echo "ssh = \"$PYTHON\" \"$TESTDIR/dummyssh\"" >> .hg/hgrc
143 143
144 find outgoing 144 find outgoing
145 145
146 $ hg out ssh://user@dummy/remote 146 $ hg out ssh://user@dummy/remote
147 comparing with ssh://user@dummy/remote 147 comparing with ssh://user@dummy/remote
154 summary: add 154 summary: add
155 155
156 156
157 find incoming on the remote side 157 find incoming on the remote side
158 158
159 $ hg incoming -R ../remote -e "$PYTHON \"$TESTDIR/dummyssh\"" ssh://user@dummy/local 159 $ hg incoming -R ../remote -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/local
160 comparing with ssh://user@dummy/local 160 comparing with ssh://user@dummy/local
161 searching for changes 161 searching for changes
162 changeset: 3:a28a9d1a809c 162 changeset: 3:a28a9d1a809c
163 tag: tip 163 tag: tip
164 parent: 0:1160648e36ce 164 parent: 0:1160648e36ce
167 summary: add 167 summary: add
168 168
169 169
170 find incoming on the remote side (using absolute path) 170 find incoming on the remote side (using absolute path)
171 171
172 $ hg incoming -R ../remote -e "$PYTHON \"$TESTDIR/dummyssh\"" "ssh://user@dummy/`pwd`" 172 $ hg incoming -R ../remote -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" "ssh://user@dummy/`pwd`"
173 comparing with ssh://user@dummy/$TESTTMP/local 173 comparing with ssh://user@dummy/$TESTTMP/local
174 searching for changes 174 searching for changes
175 changeset: 3:a28a9d1a809c 175 changeset: 3:a28a9d1a809c
176 tag: tip 176 tag: tip
177 parent: 0:1160648e36ce 177 parent: 0:1160648e36ce
214 created new head 214 created new head
215 215
216 test pushkeys and bookmarks 216 test pushkeys and bookmarks
217 217
218 $ cd ../local 218 $ cd ../local
219 $ hg debugpushkey --config ui.ssh="$PYTHON \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote namespaces 219 $ hg debugpushkey --config ui.ssh="\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote namespaces
220 bookmarks 220 bookmarks
221 namespaces 221 namespaces
222 phases 222 phases
223 $ hg book foo -r 0 223 $ hg book foo -r 0
224 $ hg out -B 224 $ hg out -B
229 pushing to ssh://user@dummy/remote 229 pushing to ssh://user@dummy/remote
230 searching for changes 230 searching for changes
231 no changes found 231 no changes found
232 exporting bookmark foo 232 exporting bookmark foo
233 [1] 233 [1]
234 $ hg debugpushkey --config ui.ssh="$PYTHON \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote bookmarks 234 $ hg debugpushkey --config ui.ssh="\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote bookmarks
235 foo 1160648e36cec0054048a7edc4110c6f84fde594 235 foo 1160648e36cec0054048a7edc4110c6f84fde594
236 $ hg book -f foo 236 $ hg book -f foo
237 $ hg push --traceback 237 $ hg push --traceback
238 pushing to ssh://user@dummy/remote 238 pushing to ssh://user@dummy/remote
239 searching for changes 239 searching for changes
309 clone bookmarks 309 clone bookmarks
310 310
311 $ hg -R ../remote bookmark test 311 $ hg -R ../remote bookmark test
312 $ hg -R ../remote bookmarks 312 $ hg -R ../remote bookmarks
313 * test 4:6c0482d977a3 313 * test 4:6c0482d977a3
314 $ hg clone -e "$PYTHON \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local-bookmarks 314 $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local-bookmarks
315 requesting all changes 315 requesting all changes
316 adding changesets 316 adding changesets
317 adding manifests 317 adding manifests
318 adding file changes 318 adding file changes
319 added 6 changesets with 5 changes to 4 files (+1 heads) 319 added 6 changesets with 5 changes to 4 files (+1 heads)
336 hide outer repo 336 hide outer repo
337 $ hg init 337 $ hg init
338 338
339 Test remote paths with spaces (issue2983): 339 Test remote paths with spaces (issue2983):
340 340
341 $ hg init --ssh "$PYTHON \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo" 341 $ hg init --ssh "\"$PYTHON\" \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
342 $ touch "$TESTTMP/a repo/test" 342 $ touch "$TESTTMP/a repo/test"
343 $ hg -R 'a repo' commit -A -m "test" 343 $ hg -R 'a repo' commit -A -m "test"
344 adding test 344 adding test
345 $ hg -R 'a repo' tag tag 345 $ hg -R 'a repo' tag tag
346 $ hg id --ssh "$PYTHON \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo" 346 $ hg id --ssh "\"$PYTHON\" \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
347 73649e48688a 347 73649e48688a
348 348
349 $ hg id --ssh "$PYTHON \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo#noNoNO" 349 $ hg id --ssh "\"$PYTHON\" \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo#noNoNO"
350 abort: unknown revision 'noNoNO'! 350 abort: unknown revision 'noNoNO'!
351 [255] 351 [255]
352 352
353 Test (non-)escaping of remote paths with spaces when cloning (issue3145): 353 Test (non-)escaping of remote paths with spaces when cloning (issue3145):
354 354
355 $ hg clone --ssh "$PYTHON \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo" 355 $ hg clone --ssh "\"$PYTHON\" \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
356 destination directory: a repo 356 destination directory: a repo
357 abort: destination 'a repo' is not empty 357 abort: destination 'a repo' is not empty
358 [255] 358 [255]
359 359
360 Make sure hg is really paranoid in serve --stdio mode. It used to be 360 Make sure hg is really paranoid in serve --stdio mode. It used to be
378 > userhost="\$1" 378 > userhost="\$1"
379 > SSH_ORIGINAL_COMMAND="\$2" 379 > SSH_ORIGINAL_COMMAND="\$2"
380 > export SSH_ORIGINAL_COMMAND 380 > export SSH_ORIGINAL_COMMAND
381 > PYTHONPATH="$PYTHONPATH" 381 > PYTHONPATH="$PYTHONPATH"
382 > export PYTHONPATH 382 > export PYTHONPATH
383 > $PYTHON "$TESTDIR/../contrib/hg-ssh" "$TESTTMP/a repo" 383 > "$PYTHON" "$TESTDIR/../contrib/hg-ssh" "$TESTTMP/a repo"
384 > EOF 384 > EOF
385 385
386 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a repo" 386 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a repo"
387 73649e48688a 387 73649e48688a
388 388
406 > userhost="\$1" 406 > userhost="\$1"
407 > SSH_ORIGINAL_COMMAND="\$2" 407 > SSH_ORIGINAL_COMMAND="\$2"
408 > export SSH_ORIGINAL_COMMAND 408 > export SSH_ORIGINAL_COMMAND
409 > PYTHONPATH="$PYTHONPATH" 409 > PYTHONPATH="$PYTHONPATH"
410 > export PYTHONPATH 410 > export PYTHONPATH
411 > $PYTHON "$TESTDIR/../contrib/hg-ssh" --read-only "$TESTTMP/remote" 411 > "$PYTHON" "$TESTDIR/../contrib/hg-ssh" --read-only "$TESTTMP/remote"
412 > EOF 412 > EOF
413 413
414 $ hg clone --ssh "sh ssh.sh" "ssh://user@dummy/$TESTTMP/remote" read-only-local 414 $ hg clone --ssh "sh ssh.sh" "ssh://user@dummy/$TESTTMP/remote" read-only-local
415 requesting all changes 415 requesting all changes
416 adding changesets 416 adding changesets
453 453
454 $ cat >> .hg/hgrc << EOF 454 $ cat >> .hg/hgrc << EOF
455 > [paths] 455 > [paths]
456 > default-push = ssh://user@dummy/remote 456 > default-push = ssh://user@dummy/remote
457 > [ui] 457 > [ui]
458 > ssh = $PYTHON "$TESTDIR/dummyssh" 458 > ssh = "$PYTHON" "$TESTDIR/dummyssh"
459 > [extensions] 459 > [extensions]
460 > localwrite = localwrite.py 460 > localwrite = localwrite.py
461 > EOF 461 > EOF
462 462
463 $ echo localwrite > foo 463 $ echo localwrite > foo
541 > return 1 541 > return 1
542 > EOF 542 > EOF
543 543
544 $ echo "pretxnchangegroup.fail = python:$TESTTMP/failhook:hook" >> remote/.hg/hgrc 544 $ echo "pretxnchangegroup.fail = python:$TESTTMP/failhook:hook" >> remote/.hg/hgrc
545 545
546 $ hg -q --config ui.ssh="$PYTHON $TESTDIR/dummyssh" clone ssh://user@dummy/remote hookout 546 $ hg -q --config ui.ssh="\"$PYTHON\" $TESTDIR/dummyssh" clone ssh://user@dummy/remote hookout
547 $ cd hookout 547 $ cd hookout
548 $ touch hookfailure 548 $ touch hookfailure
549 $ hg -q commit -A -m 'remote hook failure' 549 $ hg -q commit -A -m 'remote hook failure'
550 $ hg --config ui.ssh="$PYTHON $TESTDIR/dummyssh" push 550 $ hg --config ui.ssh="\"$PYTHON\" $TESTDIR/dummyssh" push
551 pushing to ssh://user@dummy/remote 551 pushing to ssh://user@dummy/remote
552 searching for changes 552 searching for changes
553 remote: adding changesets 553 remote: adding changesets
554 remote: adding manifests 554 remote: adding manifests
555 remote: adding file changes 555 remote: adding file changes
567 $ hg -R ../remote commit --message "more foo to be pulled" 567 $ hg -R ../remote commit --message "more foo to be pulled"
568 $ cat >> ../remote/.hg/hgrc << EOF 568 $ cat >> ../remote/.hg/hgrc << EOF
569 > [extensions] 569 > [extensions]
570 > crash = ${TESTDIR}/crashgetbundler.py 570 > crash = ${TESTDIR}/crashgetbundler.py
571 > EOF 571 > EOF
572 $ hg --config ui.ssh="$PYTHON $TESTDIR/dummyssh" pull 572 $ hg --config ui.ssh="\"$PYTHON\" $TESTDIR/dummyssh" pull
573 pulling from ssh://user@dummy/remote 573 pulling from ssh://user@dummy/remote
574 searching for changes 574 searching for changes
575 remote: abort: this is an exercise 575 remote: abort: this is an exercise
576 abort: pull failed on remote 576 abort: pull failed on remote
577 [255] 577 [255]