Mercurial > hg
comparison tests/test-ssh.t @ 33262:8e6f4939a69a
tests: replace yet more calls to `python` with $PYTHON
These are some simple cases. More to come in a future change.
Reviewers: krbullock
Reviewed By: krbullock
Differential Revision: https://phab.mercurial-scm.org/D4
author | Augie Fackler <augie@google.com> |
---|---|
date | Wed, 05 Jul 2017 11:10:11 -0500 |
parents | 616e788321cc |
children | 2428e8ec0793 |
comparison
equal
deleted
inserted
replaced
33261:be49f3fdcd10 | 33262:8e6f4939a69a |
---|---|
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 |
271 > sys.stdout.write("KABOOM IN PROCESS\n") | 271 > sys.stdout.write("KABOOM IN PROCESS\n") |
272 > EOF | 272 > EOF |
273 | 273 |
274 $ cat <<EOF >> ../remote/.hg/hgrc | 274 $ cat <<EOF >> ../remote/.hg/hgrc |
275 > [hooks] | 275 > [hooks] |
276 > changegroup.stdout = python $TESTTMP/badhook | 276 > changegroup.stdout = $PYTHON $TESTTMP/badhook |
277 > changegroup.pystdout = python:$TESTTMP/badpyhook.py:hook | 277 > changegroup.pystdout = python:$TESTTMP/badpyhook.py:hook |
278 > EOF | 278 > EOF |
279 $ echo r > r | 279 $ echo r > r |
280 $ hg ci -A -m z r | 280 $ hg ci -A -m z r |
281 | 281 |
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 |
394 $ hg id --ssh "sh ssh.sh" --remotecmd hacking "ssh://user@dummy/a'repo" | 394 $ hg id --ssh "sh ssh.sh" --remotecmd hacking "ssh://user@dummy/a'repo" |
395 remote: Illegal command "hacking -R 'a'\''repo' serve --stdio" | 395 remote: Illegal command "hacking -R 'a'\''repo' serve --stdio" |
396 abort: no suitable response from remote hg! | 396 abort: no suitable response from remote hg! |
397 [255] | 397 [255] |
398 | 398 |
399 $ SSH_ORIGINAL_COMMAND="'hg' -R 'a'repo' serve --stdio" python "$TESTDIR/../contrib/hg-ssh" | 399 $ SSH_ORIGINAL_COMMAND="'hg' -R 'a'repo' serve --stdio" $PYTHON "$TESTDIR/../contrib/hg-ssh" |
400 Illegal command "'hg' -R 'a'repo' serve --stdio": No closing quotation | 400 Illegal command "'hg' -R 'a'repo' serve --stdio": No closing quotation |
401 [255] | 401 [255] |
402 | 402 |
403 Test hg-ssh in read-only mode: | 403 Test hg-ssh in read-only mode: |
404 | 404 |
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 |
475 | 475 |
476 debug output | 476 debug output |
477 | 477 |
478 $ hg pull --debug ssh://user@dummy/remote | 478 $ hg pull --debug ssh://user@dummy/remote |
479 pulling from ssh://user@dummy/remote | 479 pulling from ssh://user@dummy/remote |
480 running python ".*/dummyssh" user@dummy ('|")hg -R remote serve --stdio('|") (re) | 480 running .* ".*/dummyssh" user@dummy ('|")hg -R remote serve --stdio('|") (re) |
481 sending hello command | 481 sending hello command |
482 sending between command | 482 sending between command |
483 remote: 355 | 483 remote: 355 |
484 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 | 484 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 |
485 remote: 1 | 485 remote: 1 |