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