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