##// END OF EJS Templates
test-ssh: stop quoting dummyssh invocation for Windows...
Matt Harbison -
r27053:c858945f default
parent child Browse files
Show More
@@ -1,543 +1,543
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 $ cat << EOF >> $HGRCPATH
4 $ cat << EOF >> $HGRCPATH
5 > [experimental]
5 > [experimental]
6 > # This test is dedicated to interaction through old bundle
6 > # This test is dedicated to interaction through old bundle
7 > bundle2-exp = False
7 > bundle2-exp = False
8 > [format] # temporary settings
8 > [format] # temporary settings
9 > usegeneraldelta=yes
9 > usegeneraldelta=yes
10 > EOF
10 > EOF
11
11
12
12
13 This test tries to exercise the ssh functionality with a dummy script
13 This test tries to exercise the ssh functionality with a dummy script
14
14
15 creating 'remote' repo
15 creating 'remote' repo
16
16
17 $ hg init remote
17 $ hg init remote
18 $ cd remote
18 $ cd remote
19 $ echo this > foo
19 $ echo this > foo
20 $ echo this > fooO
20 $ echo this > fooO
21 $ hg ci -A -m "init" foo fooO
21 $ hg ci -A -m "init" foo fooO
22
22
23 insert a closed branch (issue4428)
23 insert a closed branch (issue4428)
24
24
25 $ hg up null
25 $ hg up null
26 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
26 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
27 $ hg branch closed
27 $ hg branch closed
28 marked working directory as branch closed
28 marked working directory as branch closed
29 (branches are permanent and global, did you want a bookmark?)
29 (branches are permanent and global, did you want a bookmark?)
30 $ hg ci -mc0
30 $ hg ci -mc0
31 $ hg ci --close-branch -mc1
31 $ hg ci --close-branch -mc1
32 $ hg up -q default
32 $ hg up -q default
33
33
34 configure for serving
34 configure for serving
35
35
36 $ cat <<EOF > .hg/hgrc
36 $ cat <<EOF > .hg/hgrc
37 > [server]
37 > [server]
38 > uncompressed = True
38 > uncompressed = True
39 >
39 >
40 > [hooks]
40 > [hooks]
41 > changegroup = printenv.py changegroup-in-remote 0 ../dummylog
41 > changegroup = printenv.py changegroup-in-remote 0 ../dummylog
42 > EOF
42 > EOF
43 $ cd ..
43 $ cd ..
44
44
45 repo not found error
45 repo not found error
46
46
47 $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/nonexistent local
47 $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/nonexistent local
48 remote: abort: repository nonexistent not found!
48 remote: abort: repository nonexistent not found!
49 abort: no suitable response from remote hg!
49 abort: no suitable response from remote hg!
50 [255]
50 [255]
51
51
52 non-existent absolute path
52 non-existent absolute path
53
53
54 $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy//`pwd`/nonexistent local
54 $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy//`pwd`/nonexistent local
55 remote: abort: repository /$TESTTMP/nonexistent not found!
55 remote: abort: repository /$TESTTMP/nonexistent not found!
56 abort: no suitable response from remote hg!
56 abort: no suitable response from remote hg!
57 [255]
57 [255]
58
58
59 clone remote via stream
59 clone remote via stream
60
60
61 $ hg clone -e "python \"$TESTDIR/dummyssh\"" --uncompressed ssh://user@dummy/remote local-stream
61 $ hg clone -e "python \"$TESTDIR/dummyssh\"" --uncompressed ssh://user@dummy/remote local-stream
62 streaming all changes
62 streaming all changes
63 4 files to transfer, 615 bytes of data
63 4 files to transfer, 615 bytes of data
64 transferred 615 bytes in * seconds (*) (glob)
64 transferred 615 bytes in * seconds (*) (glob)
65 searching for changes
65 searching for changes
66 no changes found
66 no changes found
67 updating to branch default
67 updating to branch default
68 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
68 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
69 $ cd local-stream
69 $ cd local-stream
70 $ hg verify
70 $ hg verify
71 checking changesets
71 checking changesets
72 checking manifests
72 checking manifests
73 crosschecking files in changesets and manifests
73 crosschecking files in changesets and manifests
74 checking files
74 checking files
75 2 files, 3 changesets, 2 total revisions
75 2 files, 3 changesets, 2 total revisions
76 $ hg branches
76 $ hg branches
77 default 0:1160648e36ce
77 default 0:1160648e36ce
78 $ cd ..
78 $ cd ..
79
79
80 clone bookmarks via stream
80 clone bookmarks via stream
81
81
82 $ hg -R local-stream book mybook
82 $ hg -R local-stream book mybook
83 $ hg clone -e "python \"$TESTDIR/dummyssh\"" --uncompressed ssh://user@dummy/local-stream stream2
83 $ hg clone -e "python \"$TESTDIR/dummyssh\"" --uncompressed ssh://user@dummy/local-stream stream2
84 streaming all changes
84 streaming all changes
85 4 files to transfer, 615 bytes of data
85 4 files to transfer, 615 bytes of data
86 transferred 615 bytes in * seconds (*) (glob)
86 transferred 615 bytes in * seconds (*) (glob)
87 searching for changes
87 searching for changes
88 no changes found
88 no changes found
89 updating to branch default
89 updating to branch default
90 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
90 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
91 $ cd stream2
91 $ cd stream2
92 $ hg book
92 $ hg book
93 mybook 0:1160648e36ce
93 mybook 0:1160648e36ce
94 $ cd ..
94 $ cd ..
95 $ rm -rf local-stream stream2
95 $ rm -rf local-stream stream2
96
96
97 clone remote via pull
97 clone remote via pull
98
98
99 $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local
99 $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local
100 requesting all changes
100 requesting all changes
101 adding changesets
101 adding changesets
102 adding manifests
102 adding manifests
103 adding file changes
103 adding file changes
104 added 3 changesets with 2 changes to 2 files
104 added 3 changesets with 2 changes to 2 files
105 updating to branch default
105 updating to branch default
106 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
106 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
107
107
108 verify
108 verify
109
109
110 $ cd local
110 $ cd local
111 $ hg verify
111 $ hg verify
112 checking changesets
112 checking changesets
113 checking manifests
113 checking manifests
114 crosschecking files in changesets and manifests
114 crosschecking files in changesets and manifests
115 checking files
115 checking files
116 2 files, 3 changesets, 2 total revisions
116 2 files, 3 changesets, 2 total revisions
117 $ echo '[hooks]' >> .hg/hgrc
117 $ echo '[hooks]' >> .hg/hgrc
118 $ echo "changegroup = printenv.py changegroup-in-local 0 ../dummylog" >> .hg/hgrc
118 $ echo "changegroup = printenv.py changegroup-in-local 0 ../dummylog" >> .hg/hgrc
119
119
120 empty default pull
120 empty default pull
121
121
122 $ hg paths
122 $ hg paths
123 default = ssh://user@dummy/remote
123 default = ssh://user@dummy/remote
124 $ hg pull -e "python \"$TESTDIR/dummyssh\""
124 $ hg pull -e "python \"$TESTDIR/dummyssh\""
125 pulling from ssh://user@dummy/remote
125 pulling from ssh://user@dummy/remote
126 searching for changes
126 searching for changes
127 no changes found
127 no changes found
128
128
129 pull from wrong ssh URL
129 pull from wrong ssh URL
130
130
131 $ hg pull -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/doesnotexist
131 $ hg pull -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/doesnotexist
132 pulling from ssh://user@dummy/doesnotexist
132 pulling from ssh://user@dummy/doesnotexist
133 remote: abort: repository doesnotexist not found!
133 remote: abort: repository doesnotexist not found!
134 abort: no suitable response from remote hg!
134 abort: no suitable response from remote hg!
135 [255]
135 [255]
136
136
137 local change
137 local change
138
138
139 $ echo bleah > foo
139 $ echo bleah > foo
140 $ hg ci -m "add"
140 $ hg ci -m "add"
141
141
142 updating rc
142 updating rc
143
143
144 $ echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc
144 $ echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc
145 $ echo "[ui]" >> .hg/hgrc
145 $ echo "[ui]" >> .hg/hgrc
146 $ echo "ssh = python \"$TESTDIR/dummyssh\"" >> .hg/hgrc
146 $ echo "ssh = python \"$TESTDIR/dummyssh\"" >> .hg/hgrc
147
147
148 find outgoing
148 find outgoing
149
149
150 $ hg out ssh://user@dummy/remote
150 $ hg out ssh://user@dummy/remote
151 comparing with ssh://user@dummy/remote
151 comparing with ssh://user@dummy/remote
152 searching for changes
152 searching for changes
153 changeset: 3:a28a9d1a809c
153 changeset: 3:a28a9d1a809c
154 tag: tip
154 tag: tip
155 parent: 0:1160648e36ce
155 parent: 0:1160648e36ce
156 user: test
156 user: test
157 date: Thu Jan 01 00:00:00 1970 +0000
157 date: Thu Jan 01 00:00:00 1970 +0000
158 summary: add
158 summary: add
159
159
160
160
161 find incoming on the remote side
161 find incoming on the remote side
162
162
163 $ hg incoming -R ../remote -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/local
163 $ hg incoming -R ../remote -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/local
164 comparing with ssh://user@dummy/local
164 comparing with ssh://user@dummy/local
165 searching for changes
165 searching for changes
166 changeset: 3:a28a9d1a809c
166 changeset: 3:a28a9d1a809c
167 tag: tip
167 tag: tip
168 parent: 0:1160648e36ce
168 parent: 0:1160648e36ce
169 user: test
169 user: test
170 date: Thu Jan 01 00:00:00 1970 +0000
170 date: Thu Jan 01 00:00:00 1970 +0000
171 summary: add
171 summary: add
172
172
173
173
174 find incoming on the remote side (using absolute path)
174 find incoming on the remote side (using absolute path)
175
175
176 $ hg incoming -R ../remote -e "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/`pwd`"
176 $ hg incoming -R ../remote -e "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/`pwd`"
177 comparing with ssh://user@dummy/$TESTTMP/local
177 comparing with ssh://user@dummy/$TESTTMP/local
178 searching for changes
178 searching for changes
179 changeset: 3:a28a9d1a809c
179 changeset: 3:a28a9d1a809c
180 tag: tip
180 tag: tip
181 parent: 0:1160648e36ce
181 parent: 0:1160648e36ce
182 user: test
182 user: test
183 date: Thu Jan 01 00:00:00 1970 +0000
183 date: Thu Jan 01 00:00:00 1970 +0000
184 summary: add
184 summary: add
185
185
186
186
187 push
187 push
188
188
189 $ hg push
189 $ hg push
190 pushing to ssh://user@dummy/remote
190 pushing to ssh://user@dummy/remote
191 searching for changes
191 searching for changes
192 remote: adding changesets
192 remote: adding changesets
193 remote: adding manifests
193 remote: adding manifests
194 remote: adding file changes
194 remote: adding file changes
195 remote: added 1 changesets with 1 changes to 1 files
195 remote: added 1 changesets with 1 changes to 1 files
196 $ cd ../remote
196 $ cd ../remote
197
197
198 check remote tip
198 check remote tip
199
199
200 $ hg tip
200 $ hg tip
201 changeset: 3:a28a9d1a809c
201 changeset: 3:a28a9d1a809c
202 tag: tip
202 tag: tip
203 parent: 0:1160648e36ce
203 parent: 0:1160648e36ce
204 user: test
204 user: test
205 date: Thu Jan 01 00:00:00 1970 +0000
205 date: Thu Jan 01 00:00:00 1970 +0000
206 summary: add
206 summary: add
207
207
208 $ hg verify
208 $ hg verify
209 checking changesets
209 checking changesets
210 checking manifests
210 checking manifests
211 crosschecking files in changesets and manifests
211 crosschecking files in changesets and manifests
212 checking files
212 checking files
213 2 files, 4 changesets, 3 total revisions
213 2 files, 4 changesets, 3 total revisions
214 $ hg cat -r tip foo
214 $ hg cat -r tip foo
215 bleah
215 bleah
216 $ echo z > z
216 $ echo z > z
217 $ hg ci -A -m z z
217 $ hg ci -A -m z z
218 created new head
218 created new head
219
219
220 test pushkeys and bookmarks
220 test pushkeys and bookmarks
221
221
222 $ cd ../local
222 $ cd ../local
223 $ hg debugpushkey --config ui.ssh="python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote namespaces
223 $ hg debugpushkey --config ui.ssh="python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote namespaces
224 bookmarks
224 bookmarks
225 namespaces
225 namespaces
226 phases
226 phases
227 $ hg book foo -r 0
227 $ hg book foo -r 0
228 $ hg out -B
228 $ hg out -B
229 comparing with ssh://user@dummy/remote
229 comparing with ssh://user@dummy/remote
230 searching for changed bookmarks
230 searching for changed bookmarks
231 foo 1160648e36ce
231 foo 1160648e36ce
232 $ hg push -B foo
232 $ hg push -B foo
233 pushing to ssh://user@dummy/remote
233 pushing to ssh://user@dummy/remote
234 searching for changes
234 searching for changes
235 no changes found
235 no changes found
236 exporting bookmark foo
236 exporting bookmark foo
237 [1]
237 [1]
238 $ hg debugpushkey --config ui.ssh="python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote bookmarks
238 $ hg debugpushkey --config ui.ssh="python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote bookmarks
239 foo 1160648e36cec0054048a7edc4110c6f84fde594
239 foo 1160648e36cec0054048a7edc4110c6f84fde594
240 $ hg book -f foo
240 $ hg book -f foo
241 $ hg push --traceback
241 $ hg push --traceback
242 pushing to ssh://user@dummy/remote
242 pushing to ssh://user@dummy/remote
243 searching for changes
243 searching for changes
244 no changes found
244 no changes found
245 updating bookmark foo
245 updating bookmark foo
246 [1]
246 [1]
247 $ hg book -d foo
247 $ hg book -d foo
248 $ hg in -B
248 $ hg in -B
249 comparing with ssh://user@dummy/remote
249 comparing with ssh://user@dummy/remote
250 searching for changed bookmarks
250 searching for changed bookmarks
251 foo a28a9d1a809c
251 foo a28a9d1a809c
252 $ hg book -f -r 0 foo
252 $ hg book -f -r 0 foo
253 $ hg pull -B foo
253 $ hg pull -B foo
254 pulling from ssh://user@dummy/remote
254 pulling from ssh://user@dummy/remote
255 no changes found
255 no changes found
256 updating bookmark foo
256 updating bookmark foo
257 $ hg book -d foo
257 $ hg book -d foo
258 $ hg push -B foo
258 $ hg push -B foo
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 deleting remote bookmark foo
262 deleting remote bookmark foo
263 [1]
263 [1]
264
264
265 a bad, evil hook that prints to stdout
265 a bad, evil hook that prints to stdout
266
266
267 $ cat <<EOF > $TESTTMP/badhook
267 $ cat <<EOF > $TESTTMP/badhook
268 > import sys
268 > import sys
269 > sys.stdout.write("KABOOM\n")
269 > sys.stdout.write("KABOOM\n")
270 > EOF
270 > EOF
271
271
272 $ echo '[hooks]' >> ../remote/.hg/hgrc
272 $ echo '[hooks]' >> ../remote/.hg/hgrc
273 $ echo "changegroup.stdout = python $TESTTMP/badhook" >> ../remote/.hg/hgrc
273 $ echo "changegroup.stdout = python $TESTTMP/badhook" >> ../remote/.hg/hgrc
274 $ echo r > r
274 $ echo r > r
275 $ hg ci -A -m z r
275 $ hg ci -A -m z r
276
276
277 push should succeed even though it has an unexpected response
277 push should succeed even though it has an unexpected response
278
278
279 $ hg push
279 $ hg push
280 pushing to ssh://user@dummy/remote
280 pushing to ssh://user@dummy/remote
281 searching for changes
281 searching for changes
282 remote has heads on branch 'default' that are not known locally: 6c0482d977a3
282 remote has heads on branch 'default' that are not known locally: 6c0482d977a3
283 remote: adding changesets
283 remote: adding changesets
284 remote: adding manifests
284 remote: adding manifests
285 remote: adding file changes
285 remote: adding file changes
286 remote: added 1 changesets with 1 changes to 1 files
286 remote: added 1 changesets with 1 changes to 1 files
287 remote: KABOOM
287 remote: KABOOM
288 $ hg -R ../remote heads
288 $ hg -R ../remote heads
289 changeset: 5:1383141674ec
289 changeset: 5:1383141674ec
290 tag: tip
290 tag: tip
291 parent: 3:a28a9d1a809c
291 parent: 3:a28a9d1a809c
292 user: test
292 user: test
293 date: Thu Jan 01 00:00:00 1970 +0000
293 date: Thu Jan 01 00:00:00 1970 +0000
294 summary: z
294 summary: z
295
295
296 changeset: 4:6c0482d977a3
296 changeset: 4:6c0482d977a3
297 parent: 0:1160648e36ce
297 parent: 0:1160648e36ce
298 user: test
298 user: test
299 date: Thu Jan 01 00:00:00 1970 +0000
299 date: Thu Jan 01 00:00:00 1970 +0000
300 summary: z
300 summary: z
301
301
302
302
303 clone bookmarks
303 clone bookmarks
304
304
305 $ hg -R ../remote bookmark test
305 $ hg -R ../remote bookmark test
306 $ hg -R ../remote bookmarks
306 $ hg -R ../remote bookmarks
307 * test 4:6c0482d977a3
307 * test 4:6c0482d977a3
308 $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local-bookmarks
308 $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local-bookmarks
309 requesting all changes
309 requesting all changes
310 adding changesets
310 adding changesets
311 adding manifests
311 adding manifests
312 adding file changes
312 adding file changes
313 added 6 changesets with 5 changes to 4 files (+1 heads)
313 added 6 changesets with 5 changes to 4 files (+1 heads)
314 updating to branch default
314 updating to branch default
315 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
315 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
316 $ hg -R local-bookmarks bookmarks
316 $ hg -R local-bookmarks bookmarks
317 test 4:6c0482d977a3
317 test 4:6c0482d977a3
318
318
319 passwords in ssh urls are not supported
319 passwords in ssh urls are not supported
320 (we use a glob here because different Python versions give different
320 (we use a glob here because different Python versions give different
321 results here)
321 results here)
322
322
323 $ hg push ssh://user:erroneouspwd@dummy/remote
323 $ hg push ssh://user:erroneouspwd@dummy/remote
324 pushing to ssh://user:*@dummy/remote (glob)
324 pushing to ssh://user:*@dummy/remote (glob)
325 abort: password in URL not supported!
325 abort: password in URL not supported!
326 [255]
326 [255]
327
327
328 $ cd ..
328 $ cd ..
329
329
330 hide outer repo
330 hide outer repo
331 $ hg init
331 $ hg init
332
332
333 Test remote paths with spaces (issue2983):
333 Test remote paths with spaces (issue2983):
334
334
335 $ hg init --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
335 $ hg init --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
336 $ touch "$TESTTMP/a repo/test"
336 $ touch "$TESTTMP/a repo/test"
337 $ hg -R 'a repo' commit -A -m "test"
337 $ hg -R 'a repo' commit -A -m "test"
338 adding test
338 adding test
339 $ hg -R 'a repo' tag tag
339 $ hg -R 'a repo' tag tag
340 $ hg id --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
340 $ hg id --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
341 73649e48688a
341 73649e48688a
342
342
343 $ hg id --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo#noNoNO"
343 $ hg id --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo#noNoNO"
344 abort: unknown revision 'noNoNO'!
344 abort: unknown revision 'noNoNO'!
345 [255]
345 [255]
346
346
347 Test (non-)escaping of remote paths with spaces when cloning (issue3145):
347 Test (non-)escaping of remote paths with spaces when cloning (issue3145):
348
348
349 $ hg clone --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
349 $ hg clone --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
350 destination directory: a repo
350 destination directory: a repo
351 abort: destination 'a repo' is not empty
351 abort: destination 'a repo' is not empty
352 [255]
352 [255]
353
353
354 Test hg-ssh using a helper script that will restore PYTHONPATH (which might
354 Test hg-ssh using a helper script that will restore PYTHONPATH (which might
355 have been cleared by a hg.exe wrapper) and invoke hg-ssh with the right
355 have been cleared by a hg.exe wrapper) and invoke hg-ssh with the right
356 parameters:
356 parameters:
357
357
358 $ cat > ssh.sh << EOF
358 $ cat > ssh.sh << EOF
359 > userhost="\$1"
359 > userhost="\$1"
360 > SSH_ORIGINAL_COMMAND="\$2"
360 > SSH_ORIGINAL_COMMAND="\$2"
361 > export SSH_ORIGINAL_COMMAND
361 > export SSH_ORIGINAL_COMMAND
362 > PYTHONPATH="$PYTHONPATH"
362 > PYTHONPATH="$PYTHONPATH"
363 > export PYTHONPATH
363 > export PYTHONPATH
364 > python "$TESTDIR/../contrib/hg-ssh" "$TESTTMP/a repo"
364 > python "$TESTDIR/../contrib/hg-ssh" "$TESTTMP/a repo"
365 > EOF
365 > EOF
366
366
367 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a repo"
367 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a repo"
368 73649e48688a
368 73649e48688a
369
369
370 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a'repo"
370 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a'repo"
371 remote: Illegal repository "$TESTTMP/a'repo" (glob)
371 remote: Illegal repository "$TESTTMP/a'repo" (glob)
372 abort: no suitable response from remote hg!
372 abort: no suitable response from remote hg!
373 [255]
373 [255]
374
374
375 $ hg id --ssh "sh ssh.sh" --remotecmd hacking "ssh://user@dummy/a'repo"
375 $ hg id --ssh "sh ssh.sh" --remotecmd hacking "ssh://user@dummy/a'repo"
376 remote: Illegal command "hacking -R 'a'\''repo' serve --stdio"
376 remote: Illegal command "hacking -R 'a'\''repo' serve --stdio"
377 abort: no suitable response from remote hg!
377 abort: no suitable response from remote hg!
378 [255]
378 [255]
379
379
380 $ SSH_ORIGINAL_COMMAND="'hg' -R 'a'repo' serve --stdio" python "$TESTDIR/../contrib/hg-ssh"
380 $ SSH_ORIGINAL_COMMAND="'hg' -R 'a'repo' serve --stdio" python "$TESTDIR/../contrib/hg-ssh"
381 Illegal command "'hg' -R 'a'repo' serve --stdio": No closing quotation
381 Illegal command "'hg' -R 'a'repo' serve --stdio": No closing quotation
382 [255]
382 [255]
383
383
384 Test hg-ssh in read-only mode:
384 Test hg-ssh in read-only mode:
385
385
386 $ cat > ssh.sh << EOF
386 $ cat > ssh.sh << EOF
387 > userhost="\$1"
387 > userhost="\$1"
388 > SSH_ORIGINAL_COMMAND="\$2"
388 > SSH_ORIGINAL_COMMAND="\$2"
389 > export SSH_ORIGINAL_COMMAND
389 > export SSH_ORIGINAL_COMMAND
390 > PYTHONPATH="$PYTHONPATH"
390 > PYTHONPATH="$PYTHONPATH"
391 > export PYTHONPATH
391 > export PYTHONPATH
392 > python "$TESTDIR/../contrib/hg-ssh" --read-only "$TESTTMP/remote"
392 > python "$TESTDIR/../contrib/hg-ssh" --read-only "$TESTTMP/remote"
393 > EOF
393 > EOF
394
394
395 $ hg clone --ssh "sh ssh.sh" "ssh://user@dummy/$TESTTMP/remote" read-only-local
395 $ hg clone --ssh "sh ssh.sh" "ssh://user@dummy/$TESTTMP/remote" read-only-local
396 requesting all changes
396 requesting all changes
397 adding changesets
397 adding changesets
398 adding manifests
398 adding manifests
399 adding file changes
399 adding file changes
400 added 6 changesets with 5 changes to 4 files (+1 heads)
400 added 6 changesets with 5 changes to 4 files (+1 heads)
401 updating to branch default
401 updating to branch default
402 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
402 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
403
403
404 $ cd read-only-local
404 $ cd read-only-local
405 $ echo "baz" > bar
405 $ echo "baz" > bar
406 $ hg ci -A -m "unpushable commit" bar
406 $ hg ci -A -m "unpushable commit" bar
407 $ hg push --ssh "sh ../ssh.sh"
407 $ hg push --ssh "sh ../ssh.sh"
408 pushing to ssh://user@dummy/*/remote (glob)
408 pushing to ssh://user@dummy/*/remote (glob)
409 searching for changes
409 searching for changes
410 remote: Permission denied
410 remote: Permission denied
411 remote: abort: pretxnopen.hg-ssh hook failed
411 remote: abort: pretxnopen.hg-ssh hook failed
412 remote: Permission denied
412 remote: Permission denied
413 remote: pushkey-abort: prepushkey.hg-ssh hook failed
413 remote: pushkey-abort: prepushkey.hg-ssh hook failed
414 updating 6c0482d977a3 to public failed!
414 updating 6c0482d977a3 to public failed!
415 [1]
415 [1]
416
416
417 $ cd ..
417 $ cd ..
418
418
419 stderr from remote commands should be printed before stdout from local code (issue4336)
419 stderr from remote commands should be printed before stdout from local code (issue4336)
420
420
421 $ hg clone remote stderr-ordering
421 $ hg clone remote stderr-ordering
422 updating to branch default
422 updating to branch default
423 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
423 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
424 $ cd stderr-ordering
424 $ cd stderr-ordering
425 $ cat >> localwrite.py << EOF
425 $ cat >> localwrite.py << EOF
426 > from mercurial import exchange, extensions
426 > from mercurial import exchange, extensions
427 >
427 >
428 > def wrappedpush(orig, repo, *args, **kwargs):
428 > def wrappedpush(orig, repo, *args, **kwargs):
429 > res = orig(repo, *args, **kwargs)
429 > res = orig(repo, *args, **kwargs)
430 > repo.ui.write('local stdout\n')
430 > repo.ui.write('local stdout\n')
431 > return res
431 > return res
432 >
432 >
433 > def extsetup(ui):
433 > def extsetup(ui):
434 > extensions.wrapfunction(exchange, 'push', wrappedpush)
434 > extensions.wrapfunction(exchange, 'push', wrappedpush)
435 > EOF
435 > EOF
436
436
437 $ cat >> .hg/hgrc << EOF
437 $ cat >> .hg/hgrc << EOF
438 > [paths]
438 > [paths]
439 > default-push = ssh://user@dummy/remote
439 > default-push = ssh://user@dummy/remote
440 > [ui]
440 > [ui]
441 > ssh = python "$TESTDIR/dummyssh"
441 > ssh = python "$TESTDIR/dummyssh"
442 > [extensions]
442 > [extensions]
443 > localwrite = localwrite.py
443 > localwrite = localwrite.py
444 > EOF
444 > EOF
445
445
446 $ echo localwrite > foo
446 $ echo localwrite > foo
447 $ hg commit -m 'testing localwrite'
447 $ hg commit -m 'testing localwrite'
448 $ hg push
448 $ hg push
449 pushing to ssh://user@dummy/remote
449 pushing to ssh://user@dummy/remote
450 searching for changes
450 searching for changes
451 remote: adding changesets
451 remote: adding changesets
452 remote: adding manifests
452 remote: adding manifests
453 remote: adding file changes
453 remote: adding file changes
454 remote: added 1 changesets with 1 changes to 1 files
454 remote: added 1 changesets with 1 changes to 1 files
455 remote: KABOOM
455 remote: KABOOM
456 local stdout
456 local stdout
457
457
458 debug output
458 debug output
459
459
460 $ hg pull --debug ssh://user@dummy/remote
460 $ hg pull --debug ssh://user@dummy/remote
461 pulling from ssh://user@dummy/remote
461 pulling from ssh://user@dummy/remote
462 running python ".*/dummyssh" user@dummy ('|")hg -R remote serve --stdio('|") (re)
462 running python ".*/dummyssh" user@dummy ('|")hg -R remote serve --stdio('|") (re)
463 sending hello command
463 sending hello command
464 sending between command
464 sending between command
465 remote: 371
465 remote: 371
466 remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 bundle2=HG20%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024
466 remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 bundle2=HG20%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024
467 remote: 1
467 remote: 1
468 preparing listkeys for "bookmarks"
468 preparing listkeys for "bookmarks"
469 sending listkeys command
469 sending listkeys command
470 received listkey for "bookmarks": 45 bytes
470 received listkey for "bookmarks": 45 bytes
471 query 1; heads
471 query 1; heads
472 sending batch command
472 sending batch command
473 searching for changes
473 searching for changes
474 all remote heads known locally
474 all remote heads known locally
475 no changes found
475 no changes found
476 preparing listkeys for "phases"
476 preparing listkeys for "phases"
477 sending listkeys command
477 sending listkeys command
478 received listkey for "phases": 15 bytes
478 received listkey for "phases": 15 bytes
479 checking for updated bookmarks
479 checking for updated bookmarks
480
480
481 $ cd ..
481 $ cd ..
482
482
483 $ cat dummylog
483 $ cat dummylog
484 Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio
484 Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio
485 Got arguments 1:user@dummy 2:hg -R /$TESTTMP/nonexistent serve --stdio
485 Got arguments 1:user@dummy 2:hg -R /$TESTTMP/nonexistent serve --stdio
486 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
486 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
487 Got arguments 1:user@dummy 2:hg -R local-stream serve --stdio
487 Got arguments 1:user@dummy 2:hg -R local-stream serve --stdio
488 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
488 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
489 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
489 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
490 Got arguments 1:user@dummy 2:hg -R doesnotexist serve --stdio
490 Got arguments 1:user@dummy 2:hg -R doesnotexist serve --stdio
491 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
491 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
492 Got arguments 1:user@dummy 2:hg -R local serve --stdio
492 Got arguments 1:user@dummy 2:hg -R local serve --stdio
493 Got arguments 1:user@dummy 2:hg -R $TESTTMP/local serve --stdio
493 Got arguments 1:user@dummy 2:hg -R $TESTTMP/local serve --stdio
494 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
494 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
495 changegroup-in-remote hook: HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:ssh:127.0.0.1 (glob)
495 changegroup-in-remote hook: HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:ssh:127.0.0.1 (glob)
496 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
496 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
497 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
497 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
498 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
498 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
499 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
499 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
500 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
500 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
501 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
501 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
502 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
502 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
503 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
503 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
504 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
504 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
505 changegroup-in-remote hook: HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:ssh:127.0.0.1 (glob)
505 changegroup-in-remote hook: HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:ssh:127.0.0.1 (glob)
506 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
506 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
507 Got arguments 1:user@dummy 2:hg init 'a repo'
507 Got arguments 1:user@dummy 2:hg init 'a repo'
508 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
508 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
509 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
509 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
510 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
510 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
511 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
511 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
512 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
512 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
513 changegroup-in-remote hook: HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:ssh:127.0.0.1 (glob)
513 changegroup-in-remote hook: HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:ssh:127.0.0.1 (glob)
514 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
514 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
515
515
516 remote hook failure is attributed to remote
516 remote hook failure is attributed to remote
517
517
518 $ cat > $TESTTMP/failhook << EOF
518 $ cat > $TESTTMP/failhook << EOF
519 > def hook(ui, repo, **kwargs):
519 > def hook(ui, repo, **kwargs):
520 > ui.write('hook failure!\n')
520 > ui.write('hook failure!\n')
521 > ui.flush()
521 > ui.flush()
522 > return 1
522 > return 1
523 > EOF
523 > EOF
524
524
525 $ echo "pretxnchangegroup.fail = python:$TESTTMP/failhook:hook" >> remote/.hg/hgrc
525 $ echo "pretxnchangegroup.fail = python:$TESTTMP/failhook:hook" >> remote/.hg/hgrc
526
526
527 $ hg -q --config ui.ssh="python '$TESTDIR/dummyssh'" clone ssh://user@dummy/remote hookout
527 $ hg -q --config ui.ssh="python $TESTDIR/dummyssh" clone ssh://user@dummy/remote hookout
528 $ cd hookout
528 $ cd hookout
529 $ touch hookfailure
529 $ touch hookfailure
530 $ hg -q commit -A -m 'remote hook failure'
530 $ hg -q commit -A -m 'remote hook failure'
531 $ hg --config ui.ssh="python '$TESTDIR/dummyssh'" push
531 $ hg --config ui.ssh="python $TESTDIR/dummyssh" push
532 pushing to ssh://user@dummy/remote
532 pushing to ssh://user@dummy/remote
533 searching for changes
533 searching for changes
534 remote: adding changesets
534 remote: adding changesets
535 remote: adding manifests
535 remote: adding manifests
536 remote: adding file changes
536 remote: adding file changes
537 remote: added 1 changesets with 1 changes to 1 files
537 remote: added 1 changesets with 1 changes to 1 files
538 remote: hook failure!
538 remote: hook failure!
539 remote: transaction abort!
539 remote: transaction abort!
540 remote: rollback completed
540 remote: rollback completed
541 remote: abort: pretxnchangegroup.fail hook failed
541 remote: abort: pretxnchangegroup.fail hook failed
542 [1]
542 [1]
543
543
@@ -1,539 +1,539
1
1
2 This test tries to exercise the ssh functionality with a dummy script
2 This test tries to exercise the ssh functionality with a dummy script
3
3
4 $ cat <<EOF >> $HGRCPATH
4 $ cat <<EOF >> $HGRCPATH
5 > [format]
5 > [format]
6 > usegeneraldelta=yes
6 > usegeneraldelta=yes
7 > EOF
7 > EOF
8
8
9 creating 'remote' repo
9 creating 'remote' repo
10
10
11 $ hg init remote
11 $ hg init remote
12 $ cd remote
12 $ cd remote
13 $ echo this > foo
13 $ echo this > foo
14 $ echo this > fooO
14 $ echo this > fooO
15 $ hg ci -A -m "init" foo fooO
15 $ hg ci -A -m "init" foo fooO
16
16
17 insert a closed branch (issue4428)
17 insert a closed branch (issue4428)
18
18
19 $ hg up null
19 $ hg up null
20 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
20 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
21 $ hg branch closed
21 $ hg branch closed
22 marked working directory as branch closed
22 marked working directory as branch closed
23 (branches are permanent and global, did you want a bookmark?)
23 (branches are permanent and global, did you want a bookmark?)
24 $ hg ci -mc0
24 $ hg ci -mc0
25 $ hg ci --close-branch -mc1
25 $ hg ci --close-branch -mc1
26 $ hg up -q default
26 $ hg up -q default
27
27
28 configure for serving
28 configure for serving
29
29
30 $ cat <<EOF > .hg/hgrc
30 $ cat <<EOF > .hg/hgrc
31 > [server]
31 > [server]
32 > uncompressed = True
32 > uncompressed = True
33 >
33 >
34 > [hooks]
34 > [hooks]
35 > changegroup = printenv.py changegroup-in-remote 0 ../dummylog
35 > changegroup = printenv.py changegroup-in-remote 0 ../dummylog
36 > EOF
36 > EOF
37 $ cd ..
37 $ cd ..
38
38
39 repo not found error
39 repo not found error
40
40
41 $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/nonexistent local
41 $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/nonexistent local
42 remote: abort: repository nonexistent not found!
42 remote: abort: repository nonexistent not found!
43 abort: no suitable response from remote hg!
43 abort: no suitable response from remote hg!
44 [255]
44 [255]
45
45
46 non-existent absolute path
46 non-existent absolute path
47
47
48 $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/`pwd`/nonexistent local
48 $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/`pwd`/nonexistent local
49 remote: abort: repository $TESTTMP/nonexistent not found!
49 remote: abort: repository $TESTTMP/nonexistent not found!
50 abort: no suitable response from remote hg!
50 abort: no suitable response from remote hg!
51 [255]
51 [255]
52
52
53 clone remote via stream
53 clone remote via stream
54
54
55 $ hg clone -e "python \"$TESTDIR/dummyssh\"" --uncompressed ssh://user@dummy/remote local-stream
55 $ hg clone -e "python \"$TESTDIR/dummyssh\"" --uncompressed ssh://user@dummy/remote local-stream
56 streaming all changes
56 streaming all changes
57 4 files to transfer, 615 bytes of data
57 4 files to transfer, 615 bytes of data
58 transferred 615 bytes in * seconds (*) (glob)
58 transferred 615 bytes in * seconds (*) (glob)
59 searching for changes
59 searching for changes
60 no changes found
60 no changes found
61 updating to branch default
61 updating to branch default
62 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
62 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
63 $ cd local-stream
63 $ cd local-stream
64 $ hg verify
64 $ hg verify
65 checking changesets
65 checking changesets
66 checking manifests
66 checking manifests
67 crosschecking files in changesets and manifests
67 crosschecking files in changesets and manifests
68 checking files
68 checking files
69 2 files, 3 changesets, 2 total revisions
69 2 files, 3 changesets, 2 total revisions
70 $ hg branches
70 $ hg branches
71 default 0:1160648e36ce
71 default 0:1160648e36ce
72 $ cd ..
72 $ cd ..
73
73
74 clone bookmarks via stream
74 clone bookmarks via stream
75
75
76 $ hg -R local-stream book mybook
76 $ hg -R local-stream book mybook
77 $ hg clone -e "python \"$TESTDIR/dummyssh\"" --uncompressed ssh://user@dummy/local-stream stream2
77 $ hg clone -e "python \"$TESTDIR/dummyssh\"" --uncompressed ssh://user@dummy/local-stream stream2
78 streaming all changes
78 streaming all changes
79 4 files to transfer, 615 bytes of data
79 4 files to transfer, 615 bytes of data
80 transferred 615 bytes in * seconds (*) (glob)
80 transferred 615 bytes in * seconds (*) (glob)
81 searching for changes
81 searching for changes
82 no changes found
82 no changes found
83 updating to branch default
83 updating to branch default
84 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
84 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
85 $ cd stream2
85 $ cd stream2
86 $ hg book
86 $ hg book
87 mybook 0:1160648e36ce
87 mybook 0:1160648e36ce
88 $ cd ..
88 $ cd ..
89 $ rm -rf local-stream stream2
89 $ rm -rf local-stream stream2
90
90
91 clone remote via pull
91 clone remote via pull
92
92
93 $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local
93 $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local
94 requesting all changes
94 requesting all changes
95 adding changesets
95 adding changesets
96 adding manifests
96 adding manifests
97 adding file changes
97 adding file changes
98 added 3 changesets with 2 changes to 2 files
98 added 3 changesets with 2 changes to 2 files
99 updating to branch default
99 updating to branch default
100 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
100 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
101
101
102 verify
102 verify
103
103
104 $ cd local
104 $ cd local
105 $ hg verify
105 $ hg verify
106 checking changesets
106 checking changesets
107 checking manifests
107 checking manifests
108 crosschecking files in changesets and manifests
108 crosschecking files in changesets and manifests
109 checking files
109 checking files
110 2 files, 3 changesets, 2 total revisions
110 2 files, 3 changesets, 2 total revisions
111 $ echo '[hooks]' >> .hg/hgrc
111 $ echo '[hooks]' >> .hg/hgrc
112 $ echo "changegroup = printenv.py changegroup-in-local 0 ../dummylog" >> .hg/hgrc
112 $ echo "changegroup = printenv.py changegroup-in-local 0 ../dummylog" >> .hg/hgrc
113
113
114 empty default pull
114 empty default pull
115
115
116 $ hg paths
116 $ hg paths
117 default = ssh://user@dummy/remote
117 default = ssh://user@dummy/remote
118 $ hg pull -e "python \"$TESTDIR/dummyssh\""
118 $ hg pull -e "python \"$TESTDIR/dummyssh\""
119 pulling from ssh://user@dummy/remote
119 pulling from ssh://user@dummy/remote
120 searching for changes
120 searching for changes
121 no changes found
121 no changes found
122
122
123 pull from wrong ssh URL
123 pull from wrong ssh URL
124
124
125 $ hg pull -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/doesnotexist
125 $ hg pull -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/doesnotexist
126 pulling from ssh://user@dummy/doesnotexist
126 pulling from ssh://user@dummy/doesnotexist
127 remote: abort: repository doesnotexist not found!
127 remote: abort: repository doesnotexist not found!
128 abort: no suitable response from remote hg!
128 abort: no suitable response from remote hg!
129 [255]
129 [255]
130
130
131 local change
131 local change
132
132
133 $ echo bleah > foo
133 $ echo bleah > foo
134 $ hg ci -m "add"
134 $ hg ci -m "add"
135
135
136 updating rc
136 updating rc
137
137
138 $ echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc
138 $ echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc
139 $ echo "[ui]" >> .hg/hgrc
139 $ echo "[ui]" >> .hg/hgrc
140 $ echo "ssh = python \"$TESTDIR/dummyssh\"" >> .hg/hgrc
140 $ echo "ssh = python \"$TESTDIR/dummyssh\"" >> .hg/hgrc
141
141
142 find outgoing
142 find outgoing
143
143
144 $ hg out ssh://user@dummy/remote
144 $ hg out ssh://user@dummy/remote
145 comparing with ssh://user@dummy/remote
145 comparing with ssh://user@dummy/remote
146 searching for changes
146 searching for changes
147 changeset: 3:a28a9d1a809c
147 changeset: 3:a28a9d1a809c
148 tag: tip
148 tag: tip
149 parent: 0:1160648e36ce
149 parent: 0:1160648e36ce
150 user: test
150 user: test
151 date: Thu Jan 01 00:00:00 1970 +0000
151 date: Thu Jan 01 00:00:00 1970 +0000
152 summary: add
152 summary: add
153
153
154
154
155 find incoming on the remote side
155 find incoming on the remote side
156
156
157 $ hg incoming -R ../remote -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/local
157 $ hg incoming -R ../remote -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/local
158 comparing with ssh://user@dummy/local
158 comparing with ssh://user@dummy/local
159 searching for changes
159 searching for changes
160 changeset: 3:a28a9d1a809c
160 changeset: 3:a28a9d1a809c
161 tag: tip
161 tag: tip
162 parent: 0:1160648e36ce
162 parent: 0:1160648e36ce
163 user: test
163 user: test
164 date: Thu Jan 01 00:00:00 1970 +0000
164 date: Thu Jan 01 00:00:00 1970 +0000
165 summary: add
165 summary: add
166
166
167
167
168 find incoming on the remote side (using absolute path)
168 find incoming on the remote side (using absolute path)
169
169
170 $ hg incoming -R ../remote -e "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/`pwd`"
170 $ hg incoming -R ../remote -e "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/`pwd`"
171 comparing with ssh://user@dummy/$TESTTMP/local
171 comparing with ssh://user@dummy/$TESTTMP/local
172 searching for changes
172 searching for changes
173 changeset: 3:a28a9d1a809c
173 changeset: 3:a28a9d1a809c
174 tag: tip
174 tag: tip
175 parent: 0:1160648e36ce
175 parent: 0:1160648e36ce
176 user: test
176 user: test
177 date: Thu Jan 01 00:00:00 1970 +0000
177 date: Thu Jan 01 00:00:00 1970 +0000
178 summary: add
178 summary: add
179
179
180
180
181 push
181 push
182
182
183 $ hg push
183 $ hg push
184 pushing to ssh://user@dummy/remote
184 pushing to ssh://user@dummy/remote
185 searching for changes
185 searching for changes
186 remote: adding changesets
186 remote: adding changesets
187 remote: adding manifests
187 remote: adding manifests
188 remote: adding file changes
188 remote: adding file changes
189 remote: added 1 changesets with 1 changes to 1 files
189 remote: added 1 changesets with 1 changes to 1 files
190 $ cd ../remote
190 $ cd ../remote
191
191
192 check remote tip
192 check remote tip
193
193
194 $ hg tip
194 $ hg tip
195 changeset: 3:a28a9d1a809c
195 changeset: 3:a28a9d1a809c
196 tag: tip
196 tag: tip
197 parent: 0:1160648e36ce
197 parent: 0:1160648e36ce
198 user: test
198 user: test
199 date: Thu Jan 01 00:00:00 1970 +0000
199 date: Thu Jan 01 00:00:00 1970 +0000
200 summary: add
200 summary: add
201
201
202 $ hg verify
202 $ hg verify
203 checking changesets
203 checking changesets
204 checking manifests
204 checking manifests
205 crosschecking files in changesets and manifests
205 crosschecking files in changesets and manifests
206 checking files
206 checking files
207 2 files, 4 changesets, 3 total revisions
207 2 files, 4 changesets, 3 total revisions
208 $ hg cat -r tip foo
208 $ hg cat -r tip foo
209 bleah
209 bleah
210 $ echo z > z
210 $ echo z > z
211 $ hg ci -A -m z z
211 $ hg ci -A -m z z
212 created new head
212 created new head
213
213
214 test pushkeys and bookmarks
214 test pushkeys and bookmarks
215
215
216 $ cd ../local
216 $ cd ../local
217 $ hg debugpushkey --config ui.ssh="python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote namespaces
217 $ hg debugpushkey --config ui.ssh="python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote namespaces
218 bookmarks
218 bookmarks
219 namespaces
219 namespaces
220 phases
220 phases
221 $ hg book foo -r 0
221 $ hg book foo -r 0
222 $ hg out -B
222 $ hg out -B
223 comparing with ssh://user@dummy/remote
223 comparing with ssh://user@dummy/remote
224 searching for changed bookmarks
224 searching for changed bookmarks
225 foo 1160648e36ce
225 foo 1160648e36ce
226 $ hg push -B foo
226 $ hg push -B foo
227 pushing to ssh://user@dummy/remote
227 pushing to ssh://user@dummy/remote
228 searching for changes
228 searching for changes
229 no changes found
229 no changes found
230 exporting bookmark foo
230 exporting bookmark foo
231 [1]
231 [1]
232 $ hg debugpushkey --config ui.ssh="python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote bookmarks
232 $ hg debugpushkey --config ui.ssh="python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote bookmarks
233 foo 1160648e36cec0054048a7edc4110c6f84fde594
233 foo 1160648e36cec0054048a7edc4110c6f84fde594
234 $ hg book -f foo
234 $ hg book -f foo
235 $ hg push --traceback
235 $ hg push --traceback
236 pushing to ssh://user@dummy/remote
236 pushing to ssh://user@dummy/remote
237 searching for changes
237 searching for changes
238 no changes found
238 no changes found
239 updating bookmark foo
239 updating bookmark foo
240 [1]
240 [1]
241 $ hg book -d foo
241 $ hg book -d foo
242 $ hg in -B
242 $ hg in -B
243 comparing with ssh://user@dummy/remote
243 comparing with ssh://user@dummy/remote
244 searching for changed bookmarks
244 searching for changed bookmarks
245 foo a28a9d1a809c
245 foo a28a9d1a809c
246 $ hg book -f -r 0 foo
246 $ hg book -f -r 0 foo
247 $ hg pull -B foo
247 $ hg pull -B foo
248 pulling from ssh://user@dummy/remote
248 pulling from ssh://user@dummy/remote
249 no changes found
249 no changes found
250 updating bookmark foo
250 updating bookmark foo
251 $ hg book -d foo
251 $ hg book -d foo
252 $ hg push -B foo
252 $ hg push -B foo
253 pushing to ssh://user@dummy/remote
253 pushing to ssh://user@dummy/remote
254 searching for changes
254 searching for changes
255 no changes found
255 no changes found
256 deleting remote bookmark foo
256 deleting remote bookmark foo
257 [1]
257 [1]
258
258
259 a bad, evil hook that prints to stdout
259 a bad, evil hook that prints to stdout
260
260
261 $ cat <<EOF > $TESTTMP/badhook
261 $ cat <<EOF > $TESTTMP/badhook
262 > import sys
262 > import sys
263 > sys.stdout.write("KABOOM\n")
263 > sys.stdout.write("KABOOM\n")
264 > EOF
264 > EOF
265
265
266 $ echo '[hooks]' >> ../remote/.hg/hgrc
266 $ echo '[hooks]' >> ../remote/.hg/hgrc
267 $ echo "changegroup.stdout = python $TESTTMP/badhook" >> ../remote/.hg/hgrc
267 $ echo "changegroup.stdout = python $TESTTMP/badhook" >> ../remote/.hg/hgrc
268 $ echo r > r
268 $ echo r > r
269 $ hg ci -A -m z r
269 $ hg ci -A -m z r
270
270
271 push should succeed even though it has an unexpected response
271 push should succeed even though it has an unexpected response
272
272
273 $ hg push
273 $ hg push
274 pushing to ssh://user@dummy/remote
274 pushing to ssh://user@dummy/remote
275 searching for changes
275 searching for changes
276 remote has heads on branch 'default' that are not known locally: 6c0482d977a3
276 remote has heads on branch 'default' that are not known locally: 6c0482d977a3
277 remote: adding changesets
277 remote: adding changesets
278 remote: adding manifests
278 remote: adding manifests
279 remote: adding file changes
279 remote: adding file changes
280 remote: added 1 changesets with 1 changes to 1 files
280 remote: added 1 changesets with 1 changes to 1 files
281 remote: KABOOM
281 remote: KABOOM
282 $ hg -R ../remote heads
282 $ hg -R ../remote heads
283 changeset: 5:1383141674ec
283 changeset: 5:1383141674ec
284 tag: tip
284 tag: tip
285 parent: 3:a28a9d1a809c
285 parent: 3:a28a9d1a809c
286 user: test
286 user: test
287 date: Thu Jan 01 00:00:00 1970 +0000
287 date: Thu Jan 01 00:00:00 1970 +0000
288 summary: z
288 summary: z
289
289
290 changeset: 4:6c0482d977a3
290 changeset: 4:6c0482d977a3
291 parent: 0:1160648e36ce
291 parent: 0:1160648e36ce
292 user: test
292 user: test
293 date: Thu Jan 01 00:00:00 1970 +0000
293 date: Thu Jan 01 00:00:00 1970 +0000
294 summary: z
294 summary: z
295
295
296
296
297 clone bookmarks
297 clone bookmarks
298
298
299 $ hg -R ../remote bookmark test
299 $ hg -R ../remote bookmark test
300 $ hg -R ../remote bookmarks
300 $ hg -R ../remote bookmarks
301 * test 4:6c0482d977a3
301 * test 4:6c0482d977a3
302 $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local-bookmarks
302 $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local-bookmarks
303 requesting all changes
303 requesting all changes
304 adding changesets
304 adding changesets
305 adding manifests
305 adding manifests
306 adding file changes
306 adding file changes
307 added 6 changesets with 5 changes to 4 files (+1 heads)
307 added 6 changesets with 5 changes to 4 files (+1 heads)
308 updating to branch default
308 updating to branch default
309 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
309 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
310 $ hg -R local-bookmarks bookmarks
310 $ hg -R local-bookmarks bookmarks
311 test 4:6c0482d977a3
311 test 4:6c0482d977a3
312
312
313 passwords in ssh urls are not supported
313 passwords in ssh urls are not supported
314 (we use a glob here because different Python versions give different
314 (we use a glob here because different Python versions give different
315 results here)
315 results here)
316
316
317 $ hg push ssh://user:erroneouspwd@dummy/remote
317 $ hg push ssh://user:erroneouspwd@dummy/remote
318 pushing to ssh://user:*@dummy/remote (glob)
318 pushing to ssh://user:*@dummy/remote (glob)
319 abort: password in URL not supported!
319 abort: password in URL not supported!
320 [255]
320 [255]
321
321
322 $ cd ..
322 $ cd ..
323
323
324 hide outer repo
324 hide outer repo
325 $ hg init
325 $ hg init
326
326
327 Test remote paths with spaces (issue2983):
327 Test remote paths with spaces (issue2983):
328
328
329 $ hg init --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
329 $ hg init --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
330 $ touch "$TESTTMP/a repo/test"
330 $ touch "$TESTTMP/a repo/test"
331 $ hg -R 'a repo' commit -A -m "test"
331 $ hg -R 'a repo' commit -A -m "test"
332 adding test
332 adding test
333 $ hg -R 'a repo' tag tag
333 $ hg -R 'a repo' tag tag
334 $ hg id --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
334 $ hg id --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
335 73649e48688a
335 73649e48688a
336
336
337 $ hg id --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo#noNoNO"
337 $ hg id --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo#noNoNO"
338 abort: unknown revision 'noNoNO'!
338 abort: unknown revision 'noNoNO'!
339 [255]
339 [255]
340
340
341 Test (non-)escaping of remote paths with spaces when cloning (issue3145):
341 Test (non-)escaping of remote paths with spaces when cloning (issue3145):
342
342
343 $ hg clone --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
343 $ hg clone --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
344 destination directory: a repo
344 destination directory: a repo
345 abort: destination 'a repo' is not empty
345 abort: destination 'a repo' is not empty
346 [255]
346 [255]
347
347
348 Test hg-ssh using a helper script that will restore PYTHONPATH (which might
348 Test hg-ssh using a helper script that will restore PYTHONPATH (which might
349 have been cleared by a hg.exe wrapper) and invoke hg-ssh with the right
349 have been cleared by a hg.exe wrapper) and invoke hg-ssh with the right
350 parameters:
350 parameters:
351
351
352 $ cat > ssh.sh << EOF
352 $ cat > ssh.sh << EOF
353 > userhost="\$1"
353 > userhost="\$1"
354 > SSH_ORIGINAL_COMMAND="\$2"
354 > SSH_ORIGINAL_COMMAND="\$2"
355 > export SSH_ORIGINAL_COMMAND
355 > export SSH_ORIGINAL_COMMAND
356 > PYTHONPATH="$PYTHONPATH"
356 > PYTHONPATH="$PYTHONPATH"
357 > export PYTHONPATH
357 > export PYTHONPATH
358 > python "$TESTDIR/../contrib/hg-ssh" "$TESTTMP/a repo"
358 > python "$TESTDIR/../contrib/hg-ssh" "$TESTTMP/a repo"
359 > EOF
359 > EOF
360
360
361 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a repo"
361 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a repo"
362 73649e48688a
362 73649e48688a
363
363
364 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a'repo"
364 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a'repo"
365 remote: Illegal repository "$TESTTMP/a'repo" (glob)
365 remote: Illegal repository "$TESTTMP/a'repo" (glob)
366 abort: no suitable response from remote hg!
366 abort: no suitable response from remote hg!
367 [255]
367 [255]
368
368
369 $ hg id --ssh "sh ssh.sh" --remotecmd hacking "ssh://user@dummy/a'repo"
369 $ hg id --ssh "sh ssh.sh" --remotecmd hacking "ssh://user@dummy/a'repo"
370 remote: Illegal command "hacking -R 'a'\''repo' serve --stdio"
370 remote: Illegal command "hacking -R 'a'\''repo' serve --stdio"
371 abort: no suitable response from remote hg!
371 abort: no suitable response from remote hg!
372 [255]
372 [255]
373
373
374 $ SSH_ORIGINAL_COMMAND="'hg' -R 'a'repo' serve --stdio" python "$TESTDIR/../contrib/hg-ssh"
374 $ SSH_ORIGINAL_COMMAND="'hg' -R 'a'repo' serve --stdio" python "$TESTDIR/../contrib/hg-ssh"
375 Illegal command "'hg' -R 'a'repo' serve --stdio": No closing quotation
375 Illegal command "'hg' -R 'a'repo' serve --stdio": No closing quotation
376 [255]
376 [255]
377
377
378 Test hg-ssh in read-only mode:
378 Test hg-ssh in read-only mode:
379
379
380 $ cat > ssh.sh << EOF
380 $ cat > ssh.sh << EOF
381 > userhost="\$1"
381 > userhost="\$1"
382 > SSH_ORIGINAL_COMMAND="\$2"
382 > SSH_ORIGINAL_COMMAND="\$2"
383 > export SSH_ORIGINAL_COMMAND
383 > export SSH_ORIGINAL_COMMAND
384 > PYTHONPATH="$PYTHONPATH"
384 > PYTHONPATH="$PYTHONPATH"
385 > export PYTHONPATH
385 > export PYTHONPATH
386 > python "$TESTDIR/../contrib/hg-ssh" --read-only "$TESTTMP/remote"
386 > python "$TESTDIR/../contrib/hg-ssh" --read-only "$TESTTMP/remote"
387 > EOF
387 > EOF
388
388
389 $ hg clone --ssh "sh ssh.sh" "ssh://user@dummy/$TESTTMP/remote" read-only-local
389 $ hg clone --ssh "sh ssh.sh" "ssh://user@dummy/$TESTTMP/remote" read-only-local
390 requesting all changes
390 requesting all changes
391 adding changesets
391 adding changesets
392 adding manifests
392 adding manifests
393 adding file changes
393 adding file changes
394 added 6 changesets with 5 changes to 4 files (+1 heads)
394 added 6 changesets with 5 changes to 4 files (+1 heads)
395 updating to branch default
395 updating to branch default
396 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
396 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
397
397
398 $ cd read-only-local
398 $ cd read-only-local
399 $ echo "baz" > bar
399 $ echo "baz" > bar
400 $ hg ci -A -m "unpushable commit" bar
400 $ hg ci -A -m "unpushable commit" bar
401 $ hg push --ssh "sh ../ssh.sh"
401 $ hg push --ssh "sh ../ssh.sh"
402 pushing to ssh://user@dummy/*/remote (glob)
402 pushing to ssh://user@dummy/*/remote (glob)
403 searching for changes
403 searching for changes
404 remote: Permission denied
404 remote: Permission denied
405 remote: pretxnopen.hg-ssh hook failed
405 remote: pretxnopen.hg-ssh hook failed
406 abort: push failed on remote
406 abort: push failed on remote
407 [255]
407 [255]
408
408
409 $ cd ..
409 $ cd ..
410
410
411 stderr from remote commands should be printed before stdout from local code (issue4336)
411 stderr from remote commands should be printed before stdout from local code (issue4336)
412
412
413 $ hg clone remote stderr-ordering
413 $ hg clone remote stderr-ordering
414 updating to branch default
414 updating to branch default
415 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
415 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
416 $ cd stderr-ordering
416 $ cd stderr-ordering
417 $ cat >> localwrite.py << EOF
417 $ cat >> localwrite.py << EOF
418 > from mercurial import exchange, extensions
418 > from mercurial import exchange, extensions
419 >
419 >
420 > def wrappedpush(orig, repo, *args, **kwargs):
420 > def wrappedpush(orig, repo, *args, **kwargs):
421 > res = orig(repo, *args, **kwargs)
421 > res = orig(repo, *args, **kwargs)
422 > repo.ui.write('local stdout\n')
422 > repo.ui.write('local stdout\n')
423 > return res
423 > return res
424 >
424 >
425 > def extsetup(ui):
425 > def extsetup(ui):
426 > extensions.wrapfunction(exchange, 'push', wrappedpush)
426 > extensions.wrapfunction(exchange, 'push', wrappedpush)
427 > EOF
427 > EOF
428
428
429 $ cat >> .hg/hgrc << EOF
429 $ cat >> .hg/hgrc << EOF
430 > [paths]
430 > [paths]
431 > default-push = ssh://user@dummy/remote
431 > default-push = ssh://user@dummy/remote
432 > [ui]
432 > [ui]
433 > ssh = python "$TESTDIR/dummyssh"
433 > ssh = python "$TESTDIR/dummyssh"
434 > [extensions]
434 > [extensions]
435 > localwrite = localwrite.py
435 > localwrite = localwrite.py
436 > EOF
436 > EOF
437
437
438 $ echo localwrite > foo
438 $ echo localwrite > foo
439 $ hg commit -m 'testing localwrite'
439 $ hg commit -m 'testing localwrite'
440 $ hg push
440 $ hg push
441 pushing to ssh://user@dummy/remote
441 pushing to ssh://user@dummy/remote
442 searching for changes
442 searching for changes
443 remote: adding changesets
443 remote: adding changesets
444 remote: adding manifests
444 remote: adding manifests
445 remote: adding file changes
445 remote: adding file changes
446 remote: added 1 changesets with 1 changes to 1 files
446 remote: added 1 changesets with 1 changes to 1 files
447 remote: KABOOM
447 remote: KABOOM
448 local stdout
448 local stdout
449
449
450 debug output
450 debug output
451
451
452 $ hg pull --debug ssh://user@dummy/remote
452 $ hg pull --debug ssh://user@dummy/remote
453 pulling from ssh://user@dummy/remote
453 pulling from ssh://user@dummy/remote
454 running python ".*/dummyssh" user@dummy ('|")hg -R remote serve --stdio('|") (re)
454 running python ".*/dummyssh" user@dummy ('|")hg -R remote serve --stdio('|") (re)
455 sending hello command
455 sending hello command
456 sending between command
456 sending between command
457 remote: 371
457 remote: 371
458 remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 bundle2=HG20%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024
458 remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 bundle2=HG20%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024
459 remote: 1
459 remote: 1
460 query 1; heads
460 query 1; heads
461 sending batch command
461 sending batch command
462 searching for changes
462 searching for changes
463 all remote heads known locally
463 all remote heads known locally
464 no changes found
464 no changes found
465 sending getbundle command
465 sending getbundle command
466 bundle2-input-bundle: with-transaction
466 bundle2-input-bundle: with-transaction
467 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
467 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
468 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
468 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
469 bundle2-input-part: total payload size 45
469 bundle2-input-part: total payload size 45
470 bundle2-input-bundle: 1 parts total
470 bundle2-input-bundle: 1 parts total
471 checking for updated bookmarks
471 checking for updated bookmarks
472 preparing listkeys for "phases"
472 preparing listkeys for "phases"
473 sending listkeys command
473 sending listkeys command
474 received listkey for "phases": 15 bytes
474 received listkey for "phases": 15 bytes
475
475
476 $ cd ..
476 $ cd ..
477
477
478 $ cat dummylog
478 $ cat dummylog
479 Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio
479 Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio
480 Got arguments 1:user@dummy 2:hg -R $TESTTMP/nonexistent serve --stdio
480 Got arguments 1:user@dummy 2:hg -R $TESTTMP/nonexistent serve --stdio
481 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
481 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
482 Got arguments 1:user@dummy 2:hg -R local-stream serve --stdio
482 Got arguments 1:user@dummy 2:hg -R local-stream serve --stdio
483 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
483 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
484 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
484 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
485 Got arguments 1:user@dummy 2:hg -R doesnotexist serve --stdio
485 Got arguments 1:user@dummy 2:hg -R doesnotexist serve --stdio
486 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
486 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
487 Got arguments 1:user@dummy 2:hg -R local serve --stdio
487 Got arguments 1:user@dummy 2:hg -R local serve --stdio
488 Got arguments 1:user@dummy 2:hg -R $TESTTMP/local serve --stdio
488 Got arguments 1:user@dummy 2:hg -R $TESTTMP/local serve --stdio
489 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
489 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
490 changegroup-in-remote hook: HG_BUNDLE2=1 HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:ssh:127.0.0.1 (glob)
490 changegroup-in-remote hook: HG_BUNDLE2=1 HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:ssh:127.0.0.1 (glob)
491 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
491 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
492 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
492 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
493 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
493 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
494 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
494 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
495 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
495 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
496 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
496 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
497 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
497 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
498 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
498 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
499 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
499 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
500 changegroup-in-remote hook: HG_BUNDLE2=1 HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:ssh:127.0.0.1 (glob)
500 changegroup-in-remote hook: HG_BUNDLE2=1 HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:ssh:127.0.0.1 (glob)
501 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
501 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
502 Got arguments 1:user@dummy 2:hg init 'a repo'
502 Got arguments 1:user@dummy 2:hg init 'a repo'
503 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
503 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
504 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
504 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
505 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
505 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
506 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
506 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
507 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
507 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
508 changegroup-in-remote hook: HG_BUNDLE2=1 HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:ssh:127.0.0.1 (glob)
508 changegroup-in-remote hook: HG_BUNDLE2=1 HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:ssh:127.0.0.1 (glob)
509 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
509 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
510
510
511 remote hook failure is attributed to remote
511 remote hook failure is attributed to remote
512
512
513 $ cat > $TESTTMP/failhook << EOF
513 $ cat > $TESTTMP/failhook << EOF
514 > def hook(ui, repo, **kwargs):
514 > def hook(ui, repo, **kwargs):
515 > ui.write('hook failure!\n')
515 > ui.write('hook failure!\n')
516 > ui.flush()
516 > ui.flush()
517 > return 1
517 > return 1
518 > EOF
518 > EOF
519
519
520 $ echo "pretxnchangegroup.fail = python:$TESTTMP/failhook:hook" >> remote/.hg/hgrc
520 $ echo "pretxnchangegroup.fail = python:$TESTTMP/failhook:hook" >> remote/.hg/hgrc
521
521
522 $ hg -q --config ui.ssh="python '$TESTDIR/dummyssh'" clone ssh://user@dummy/remote hookout
522 $ hg -q --config ui.ssh="python $TESTDIR/dummyssh" clone ssh://user@dummy/remote hookout
523 $ cd hookout
523 $ cd hookout
524 $ touch hookfailure
524 $ touch hookfailure
525 $ hg -q commit -A -m 'remote hook failure'
525 $ hg -q commit -A -m 'remote hook failure'
526 $ hg --config ui.ssh="python '$TESTDIR/dummyssh'" push
526 $ hg --config ui.ssh="python $TESTDIR/dummyssh" push
527 pushing to ssh://user@dummy/remote
527 pushing to ssh://user@dummy/remote
528 searching for changes
528 searching for changes
529 remote: adding changesets
529 remote: adding changesets
530 remote: adding manifests
530 remote: adding manifests
531 remote: adding file changes
531 remote: adding file changes
532 remote: added 1 changesets with 1 changes to 1 files
532 remote: added 1 changesets with 1 changes to 1 files
533 remote: hook failure!
533 remote: hook failure!
534 remote: transaction abort!
534 remote: transaction abort!
535 remote: rollback completed
535 remote: rollback completed
536 remote: pretxnchangegroup.fail hook failed
536 remote: pretxnchangegroup.fail hook failed
537 abort: push failed on remote
537 abort: push failed on remote
538 [255]
538 [255]
539
539
General Comments 0
You need to be logged in to leave comments. Login now