tests/test-ssh.t
branchstable
changeset 16350 4f795f5fbb0b
parent 16107 a3dcc59054ca
child 16540 4fe8eb4a6e2c
equal deleted inserted replaced
16349:425f1fbcfb94 16350:4f795f5fbb0b
    18   > EOF
    18   > EOF
    19   $ cd ..
    19   $ cd ..
    20 
    20 
    21 repo not found error
    21 repo not found error
    22 
    22 
    23   $ hg clone -e "python $TESTDIR/dummyssh" ssh://user@dummy/nonexistent local
    23   $ hg clone -e 'python "$TESTDIR/dummyssh"' ssh://user@dummy/nonexistent local
    24   remote: abort: There is no Mercurial repository here (.hg not found)!
    24   remote: abort: There is no Mercurial repository here (.hg not found)!
    25   abort: no suitable response from remote hg!
    25   abort: no suitable response from remote hg!
    26   [255]
    26   [255]
    27 
    27 
    28 non-existent absolute path
    28 non-existent absolute path
    29 
    29 
    30   $ hg clone -e "python $TESTDIR/dummyssh" ssh://user@dummy//`pwd`/nonexistent local
    30   $ hg clone -e 'python "$TESTDIR/dummyssh"' ssh://user@dummy//`pwd`/nonexistent local
    31   remote: abort: There is no Mercurial repository here (.hg not found)!
    31   remote: abort: There is no Mercurial repository here (.hg not found)!
    32   abort: no suitable response from remote hg!
    32   abort: no suitable response from remote hg!
    33   [255]
    33   [255]
    34 
    34 
    35 clone remote via stream
    35 clone remote via stream
    36 
    36 
    37   $ hg clone -e "python $TESTDIR/dummyssh" --uncompressed ssh://user@dummy/remote local-stream
    37   $ hg clone -e 'python "$TESTDIR/dummyssh"' --uncompressed ssh://user@dummy/remote local-stream
    38   streaming all changes
    38   streaming all changes
    39   4 files to transfer, 392 bytes of data
    39   4 files to transfer, 392 bytes of data
    40   transferred 392 bytes in * seconds (*/sec) (glob)
    40   transferred 392 bytes in * seconds (*/sec) (glob)
    41   updating to branch default
    41   updating to branch default
    42   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
    42   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
    49   2 files, 1 changesets, 2 total revisions
    49   2 files, 1 changesets, 2 total revisions
    50   $ cd ..
    50   $ cd ..
    51 
    51 
    52 clone remote via pull
    52 clone remote via pull
    53 
    53 
    54   $ hg clone -e "python $TESTDIR/dummyssh" ssh://user@dummy/remote local
    54   $ hg clone -e 'python "$TESTDIR/dummyssh"' ssh://user@dummy/remote local
    55   requesting all changes
    55   requesting all changes
    56   adding changesets
    56   adding changesets
    57   adding manifests
    57   adding manifests
    58   adding file changes
    58   adding file changes
    59   added 1 changesets with 2 changes to 2 files
    59   added 1 changesets with 2 changes to 2 files
    74 
    74 
    75 empty default pull
    75 empty default pull
    76 
    76 
    77   $ hg paths
    77   $ hg paths
    78   default = ssh://user@dummy/remote
    78   default = ssh://user@dummy/remote
    79   $ hg pull -e "python $TESTDIR/dummyssh"
    79   $ hg pull -e 'python "$TESTDIR/dummyssh"'
    80   pulling from ssh://user@dummy/remote
    80   pulling from ssh://user@dummy/remote
    81   searching for changes
    81   searching for changes
    82   no changes found
    82   no changes found
    83 
    83 
    84 local change
    84 local change
    88 
    88 
    89 updating rc
    89 updating rc
    90 
    90 
    91   $ echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc
    91   $ echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc
    92   $ echo "[ui]" >> .hg/hgrc
    92   $ echo "[ui]" >> .hg/hgrc
    93   $ echo "ssh = python $TESTDIR/dummyssh" >> .hg/hgrc
    93   $ echo 'ssh = python "$TESTDIR/dummyssh"' >> .hg/hgrc
    94 
    94 
    95 find outgoing
    95 find outgoing
    96 
    96 
    97   $ hg out ssh://user@dummy/remote
    97   $ hg out ssh://user@dummy/remote
    98   comparing with ssh://user@dummy/remote
    98   comparing with ssh://user@dummy/remote
   104   summary:     add
   104   summary:     add
   105   
   105   
   106 
   106 
   107 find incoming on the remote side
   107 find incoming on the remote side
   108 
   108 
   109   $ hg incoming -R ../remote -e "python $TESTDIR/dummyssh" ssh://user@dummy/local
   109   $ hg incoming -R ../remote -e 'python "$TESTDIR/dummyssh"' ssh://user@dummy/local
   110   comparing with ssh://user@dummy/local
   110   comparing with ssh://user@dummy/local
   111   searching for changes
   111   searching for changes
   112   changeset:   1:a28a9d1a809c
   112   changeset:   1:a28a9d1a809c
   113   tag:         tip
   113   tag:         tip
   114   user:        test
   114   user:        test
   116   summary:     add
   116   summary:     add
   117   
   117   
   118 
   118 
   119 find incoming on the remote side (using absolute path)
   119 find incoming on the remote side (using absolute path)
   120 
   120 
   121   $ hg incoming -R ../remote -e "python $TESTDIR/dummyssh" "ssh://user@dummy/`pwd`"
   121   $ hg incoming -R ../remote -e 'python "$TESTDIR/dummyssh"' "ssh://user@dummy/`pwd`"
   122   comparing with ssh://user@dummy/$TESTTMP/local
   122   comparing with ssh://user@dummy/$TESTTMP/local
   123   searching for changes
   123   searching for changes
   124   changeset:   1:a28a9d1a809c
   124   changeset:   1:a28a9d1a809c
   125   tag:         tip
   125   tag:         tip
   126   user:        test
   126   user:        test
   161   created new head
   161   created new head
   162 
   162 
   163 test pushkeys and bookmarks
   163 test pushkeys and bookmarks
   164 
   164 
   165   $ cd ../local
   165   $ cd ../local
   166   $ hg debugpushkey --config ui.ssh="python $TESTDIR/dummyssh" ssh://user@dummy/remote namespaces
   166   $ hg debugpushkey --config ui.ssh='python "$TESTDIR/dummyssh"' ssh://user@dummy/remote namespaces
   167   bookmarks	
   167   bookmarks	
   168   phases	
   168   phases	
   169   namespaces	
   169   namespaces	
   170   $ hg book foo -r 0
   170   $ hg book foo -r 0
   171   $ hg out -B
   171   $ hg out -B
   176   pushing to ssh://user@dummy/remote
   176   pushing to ssh://user@dummy/remote
   177   searching for changes
   177   searching for changes
   178   no changes found
   178   no changes found
   179   exporting bookmark foo
   179   exporting bookmark foo
   180   [1]
   180   [1]
   181   $ hg debugpushkey --config ui.ssh="python $TESTDIR/dummyssh" ssh://user@dummy/remote bookmarks
   181   $ hg debugpushkey --config ui.ssh='python "$TESTDIR/dummyssh"' ssh://user@dummy/remote bookmarks
   182   foo	1160648e36cec0054048a7edc4110c6f84fde594
   182   foo	1160648e36cec0054048a7edc4110c6f84fde594
   183   $ hg book -f foo
   183   $ hg book -f foo
   184   $ hg push --traceback
   184   $ hg push --traceback
   185   pushing to ssh://user@dummy/remote
   185   pushing to ssh://user@dummy/remote
   186   searching for changes
   186   searching for changes
   247 clone bookmarks
   247 clone bookmarks
   248 
   248 
   249   $ hg -R ../remote bookmark test
   249   $ hg -R ../remote bookmark test
   250   $ hg -R ../remote bookmarks
   250   $ hg -R ../remote bookmarks
   251    * test                      2:6c0482d977a3
   251    * test                      2:6c0482d977a3
   252   $ hg clone -e "python $TESTDIR/dummyssh" ssh://user@dummy/remote local-bookmarks
   252   $ hg clone -e 'python "$TESTDIR/dummyssh"' ssh://user@dummy/remote local-bookmarks
   253   requesting all changes
   253   requesting all changes
   254   adding changesets
   254   adding changesets
   255   adding manifests
   255   adding manifests
   256   adding file changes
   256   adding file changes
   257   added 4 changesets with 5 changes to 4 files (+1 heads)
   257   added 4 changesets with 5 changes to 4 files (+1 heads)
   271 
   271 
   272   $ cd ..
   272   $ cd ..
   273 
   273 
   274 Test remote paths with spaces (issue2983):
   274 Test remote paths with spaces (issue2983):
   275 
   275 
   276   $ hg init --ssh "python $TESTDIR/dummyssh" "ssh://user@dummy/a repo"
   276   $ hg init --ssh 'python "$TESTDIR/dummyssh"' "ssh://user@dummy/a repo"
   277   $ hg -R 'a repo' tag tag
   277   $ hg -R 'a repo' tag tag
   278   $ hg id --ssh "python $TESTDIR/dummyssh" "ssh://user@dummy/a repo"
   278   $ hg id --ssh 'python "$TESTDIR/dummyssh"' "ssh://user@dummy/a repo"
   279   3fb238f49e8c
   279   3fb238f49e8c
   280 
   280 
   281 Test hg-ssh:
   281 Test hg-ssh:
   282 
   282 
   283   $ SSH_ORIGINAL_COMMAND="'hg' -R 'a repo' serve --stdio" hg id --ssh "python \"$TESTDIR\"/../contrib/hg-ssh \"$TESTTMP/a repo\"" "ssh://user@dummy/a repo"
   283   $ SSH_ORIGINAL_COMMAND="'hg' -R 'a repo' serve --stdio" hg id --ssh "python \"$TESTDIR\"/../contrib/hg-ssh \"$TESTTMP/a repo\"" "ssh://user@dummy/a repo"