tests/test-ssh.t
changeset 45921 95c4cca641f6
parent 45866 d68618954ade
child 46086 e0866c047e64
equal deleted inserted replaced
45920:e131dbf6ee15 45921:95c4cca641f6
    41   $ cd $TESTTMP
    41   $ cd $TESTTMP
    42 
    42 
    43 repo not found error
    43 repo not found error
    44 
    44 
    45   $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/nonexistent local
    45   $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/nonexistent local
    46   remote: abort: repository nonexistent not found!
    46   remote: abort: repository nonexistent not found
    47   abort: no suitable response from remote hg!
    47   abort: no suitable response from remote hg
    48   [255]
    48   [255]
    49   $ hg clone -q -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/nonexistent local
    49   $ hg clone -q -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/nonexistent local
    50   remote: abort: repository nonexistent not found!
    50   remote: abort: repository nonexistent not found
    51   abort: no suitable response from remote hg!
    51   abort: no suitable response from remote hg
    52   [255]
    52   [255]
    53 
    53 
    54 non-existent absolute path
    54 non-existent absolute path
    55 
    55 
    56   $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/`pwd`/nonexistent local
    56   $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/`pwd`/nonexistent local
    57   remote: abort: repository $TESTTMP/nonexistent not found!
    57   remote: abort: repository $TESTTMP/nonexistent not found
    58   abort: no suitable response from remote hg!
    58   abort: no suitable response from remote hg
    59   [255]
    59   [255]
    60 
    60 
    61 clone remote via stream
    61 clone remote via stream
    62 
    62 
    63 #if no-reposimplestore
    63 #if no-reposimplestore
   133 
   133 
   134 pull from wrong ssh URL
   134 pull from wrong ssh URL
   135 
   135 
   136   $ hg pull -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/doesnotexist
   136   $ hg pull -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/doesnotexist
   137   pulling from ssh://user@dummy/doesnotexist
   137   pulling from ssh://user@dummy/doesnotexist
   138   remote: abort: repository doesnotexist not found!
   138   remote: abort: repository doesnotexist not found
   139   abort: no suitable response from remote hg!
   139   abort: no suitable response from remote hg
   140   [255]
   140   [255]
   141 
   141 
   142 local change
   142 local change
   143 
   143 
   144   $ echo bleah > foo
   144   $ echo bleah > foo
   358 (we use a glob here because different Python versions give different
   358 (we use a glob here because different Python versions give different
   359 results here)
   359 results here)
   360 
   360 
   361   $ hg push ssh://user:erroneouspwd@dummy/remote
   361   $ hg push ssh://user:erroneouspwd@dummy/remote
   362   pushing to ssh://user:*@dummy/remote (glob)
   362   pushing to ssh://user:*@dummy/remote (glob)
   363   abort: password in URL not supported!
   363   abort: password in URL not supported
   364   [255]
   364   [255]
   365 
   365 
   366   $ cd $TESTTMP
   366   $ cd $TESTTMP
   367 
   367 
   368 hide outer repo
   368 hide outer repo
   377   $ hg -R 'a repo' tag tag
   377   $ hg -R 'a repo' tag tag
   378   $ hg id --ssh "\"$PYTHON\" \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
   378   $ hg id --ssh "\"$PYTHON\" \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
   379   73649e48688a
   379   73649e48688a
   380 
   380 
   381   $ hg id --ssh "\"$PYTHON\" \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo#noNoNO"
   381   $ hg id --ssh "\"$PYTHON\" \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo#noNoNO"
   382   abort: unknown revision 'noNoNO'!
   382   abort: unknown revision 'noNoNO'
   383   [255]
   383   [255]
   384 
   384 
   385 Test (non-)escaping of remote paths with spaces when cloning (issue3145):
   385 Test (non-)escaping of remote paths with spaces when cloning (issue3145):
   386 
   386 
   387   $ hg clone --ssh "\"$PYTHON\" \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
   387   $ hg clone --ssh "\"$PYTHON\" \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
   418   $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a repo"
   418   $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a repo"
   419   73649e48688a
   419   73649e48688a
   420 
   420 
   421   $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a'repo"
   421   $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a'repo"
   422   remote: Illegal repository "$TESTTMP/a'repo"
   422   remote: Illegal repository "$TESTTMP/a'repo"
   423   abort: no suitable response from remote hg!
   423   abort: no suitable response from remote hg
   424   [255]
   424   [255]
   425 
   425 
   426   $ hg id --ssh "sh ssh.sh" --remotecmd hacking "ssh://user@dummy/a'repo"
   426   $ hg id --ssh "sh ssh.sh" --remotecmd hacking "ssh://user@dummy/a'repo"
   427   remote: Illegal command "hacking -R 'a'\''repo' serve --stdio"
   427   remote: Illegal command "hacking -R 'a'\''repo' serve --stdio"
   428   abort: no suitable response from remote hg!
   428   abort: no suitable response from remote hg
   429   [255]
   429   [255]
   430 
   430 
   431   $ SSH_ORIGINAL_COMMAND="'hg' -R 'a'repo' serve --stdio" "$PYTHON" "$TESTDIR/../contrib/hg-ssh"
   431   $ SSH_ORIGINAL_COMMAND="'hg' -R 'a'repo' serve --stdio" "$PYTHON" "$TESTDIR/../contrib/hg-ssh"
   432   Illegal command "'hg' -R 'a'repo' serve --stdio": No closing quotation
   432   Illegal command "'hg' -R 'a'repo' serve --stdio": No closing quotation
   433   [255]
   433   [255]
   673 
   673 
   674 abort with no error hint when there is a ssh problem when pulling
   674 abort with no error hint when there is a ssh problem when pulling
   675 
   675 
   676   $ hg pull ssh://brokenrepository -e "\"$PYTHON\" \"$TESTDIR/dummyssh\""
   676   $ hg pull ssh://brokenrepository -e "\"$PYTHON\" \"$TESTDIR/dummyssh\""
   677   pulling from ssh://brokenrepository/
   677   pulling from ssh://brokenrepository/
   678   abort: no suitable response from remote hg!
   678   abort: no suitable response from remote hg
   679   [255]
   679   [255]
   680 
   680 
   681 abort with configured error hint when there is a ssh problem when pulling
   681 abort with configured error hint when there is a ssh problem when pulling
   682 
   682 
   683   $ hg pull ssh://brokenrepository -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" \
   683   $ hg pull ssh://brokenrepository -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" \
   684   > --config ui.ssherrorhint="Please see http://company/internalwiki/ssh.html"
   684   > --config ui.ssherrorhint="Please see http://company/internalwiki/ssh.html"
   685   pulling from ssh://brokenrepository/
   685   pulling from ssh://brokenrepository/
   686   abort: no suitable response from remote hg!
   686   abort: no suitable response from remote hg
   687   (Please see http://company/internalwiki/ssh.html)
   687   (Please see http://company/internalwiki/ssh.html)
   688   [255]
   688   [255]
   689 
   689 
   690 test that custom environment is passed down to ssh executable
   690 test that custom environment is passed down to ssh executable
   691   $ cat >>dumpenv <<EOF
   691   $ cat >>dumpenv <<EOF
   694   > EOF
   694   > EOF
   695   $ chmod +x dumpenv
   695   $ chmod +x dumpenv
   696   $ hg pull ssh://something --config ui.ssh="sh dumpenv"
   696   $ hg pull ssh://something --config ui.ssh="sh dumpenv"
   697   pulling from ssh://something/
   697   pulling from ssh://something/
   698   remote: 
   698   remote: 
   699   abort: no suitable response from remote hg!
   699   abort: no suitable response from remote hg
   700   [255]
   700   [255]
   701   $ hg pull ssh://something --config ui.ssh="sh dumpenv" --config sshenv.VAR=17
   701   $ hg pull ssh://something --config ui.ssh="sh dumpenv" --config sshenv.VAR=17
   702   pulling from ssh://something/
   702   pulling from ssh://something/
   703   remote: 17
   703   remote: 17
   704   abort: no suitable response from remote hg!
   704   abort: no suitable response from remote hg
   705   [255]
   705   [255]
   706 
   706