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