Show More
@@ -1,389 +1,432 b'' | |||||
1 |
|
1 | |||
2 |
|
2 | |||
3 | This test tries to exercise the ssh functionality with a dummy script |
|
3 | This test tries to exercise the ssh functionality with a dummy script | |
4 |
|
4 | |||
5 | creating 'remote' repo |
|
5 | creating 'remote' repo | |
6 |
|
6 | |||
7 | $ hg init remote |
|
7 | $ hg init remote | |
8 | $ cd remote |
|
8 | $ cd remote | |
9 | $ echo this > foo |
|
9 | $ echo this > foo | |
10 | $ echo this > fooO |
|
10 | $ echo this > fooO | |
11 | $ hg ci -A -m "init" foo fooO |
|
11 | $ hg ci -A -m "init" foo fooO | |
12 | $ cat <<EOF > .hg/hgrc |
|
12 | $ cat <<EOF > .hg/hgrc | |
13 | > [server] |
|
13 | > [server] | |
14 | > uncompressed = True |
|
14 | > uncompressed = True | |
15 | > |
|
15 | > | |
16 | > [hooks] |
|
16 | > [hooks] | |
17 | > changegroup = python "$TESTDIR/printenv.py" changegroup-in-remote 0 ../dummylog |
|
17 | > changegroup = python "$TESTDIR/printenv.py" changegroup-in-remote 0 ../dummylog | |
18 | > EOF |
|
18 | > EOF | |
19 | $ cd .. |
|
19 | $ cd .. | |
20 |
|
20 | |||
21 | repo not found error |
|
21 | repo not found error | |
22 |
|
22 | |||
23 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/nonexistent local |
|
23 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/nonexistent local | |
24 | remote: abort: there is no Mercurial repository here (.hg not found)! |
|
24 | remote: abort: there is no Mercurial repository here (.hg not found)! | |
25 | abort: no suitable response from remote hg! |
|
25 | abort: no suitable response from remote hg! | |
26 | [255] |
|
26 | [255] | |
27 |
|
27 | |||
28 | non-existent absolute path |
|
28 | non-existent absolute path | |
29 |
|
29 | |||
30 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy//`pwd`/nonexistent local |
|
30 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy//`pwd`/nonexistent local | |
31 | remote: abort: there is no Mercurial repository here (.hg not found)! |
|
31 | remote: abort: there is no Mercurial repository here (.hg not found)! | |
32 | abort: no suitable response from remote hg! |
|
32 | abort: no suitable response from remote hg! | |
33 | [255] |
|
33 | [255] | |
34 |
|
34 | |||
35 | clone remote via stream |
|
35 | clone remote via stream | |
36 |
|
36 | |||
37 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" --uncompressed ssh://user@dummy/remote local-stream |
|
37 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" --uncompressed ssh://user@dummy/remote local-stream | |
38 | streaming all changes |
|
38 | streaming all changes | |
39 | 4 files to transfer, 392 bytes of data |
|
39 | 4 files to transfer, 392 bytes of data | |
40 | transferred 392 bytes in * seconds (*/sec) (glob) |
|
40 | transferred 392 bytes in * seconds (*/sec) (glob) | |
41 | updating to branch default |
|
41 | updating to branch default | |
42 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
42 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
43 | $ cd local-stream |
|
43 | $ cd local-stream | |
44 | $ hg verify |
|
44 | $ hg verify | |
45 | checking changesets |
|
45 | checking changesets | |
46 | checking manifests |
|
46 | checking manifests | |
47 | crosschecking files in changesets and manifests |
|
47 | crosschecking files in changesets and manifests | |
48 | checking files |
|
48 | checking files | |
49 | 2 files, 1 changesets, 2 total revisions |
|
49 | 2 files, 1 changesets, 2 total revisions | |
50 | $ cd .. |
|
50 | $ cd .. | |
51 |
|
51 | |||
52 | clone remote via pull |
|
52 | clone remote via pull | |
53 |
|
53 | |||
54 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local |
|
54 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local | |
55 | requesting all changes |
|
55 | requesting all changes | |
56 | adding changesets |
|
56 | adding changesets | |
57 | adding manifests |
|
57 | adding manifests | |
58 | adding file changes |
|
58 | adding file changes | |
59 | added 1 changesets with 2 changes to 2 files |
|
59 | added 1 changesets with 2 changes to 2 files | |
60 | updating to branch default |
|
60 | updating to branch default | |
61 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
61 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
62 |
|
62 | |||
63 | verify |
|
63 | verify | |
64 |
|
64 | |||
65 | $ cd local |
|
65 | $ cd local | |
66 | $ hg verify |
|
66 | $ hg verify | |
67 | checking changesets |
|
67 | checking changesets | |
68 | checking manifests |
|
68 | checking manifests | |
69 | crosschecking files in changesets and manifests |
|
69 | crosschecking files in changesets and manifests | |
70 | checking files |
|
70 | checking files | |
71 | 2 files, 1 changesets, 2 total revisions |
|
71 | 2 files, 1 changesets, 2 total revisions | |
72 | $ echo '[hooks]' >> .hg/hgrc |
|
72 | $ echo '[hooks]' >> .hg/hgrc | |
73 | $ echo "changegroup = python \"$TESTDIR/printenv.py\" changegroup-in-local 0 ../dummylog" >> .hg/hgrc |
|
73 | $ echo "changegroup = python \"$TESTDIR/printenv.py\" changegroup-in-local 0 ../dummylog" >> .hg/hgrc | |
74 |
|
74 | |||
75 | empty default pull |
|
75 | empty default pull | |
76 |
|
76 | |||
77 | $ hg paths |
|
77 | $ hg paths | |
78 | default = ssh://user@dummy/remote |
|
78 | default = ssh://user@dummy/remote | |
79 | $ hg pull -e "python \"$TESTDIR/dummyssh\"" |
|
79 | $ hg pull -e "python \"$TESTDIR/dummyssh\"" | |
80 | pulling from ssh://user@dummy/remote |
|
80 | pulling from ssh://user@dummy/remote | |
81 | searching for changes |
|
81 | searching for changes | |
82 | no changes found |
|
82 | no changes found | |
83 |
|
83 | |||
84 | local change |
|
84 | local change | |
85 |
|
85 | |||
86 | $ echo bleah > foo |
|
86 | $ echo bleah > foo | |
87 | $ hg ci -m "add" |
|
87 | $ hg ci -m "add" | |
88 |
|
88 | |||
89 | updating rc |
|
89 | updating rc | |
90 |
|
90 | |||
91 | $ echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc |
|
91 | $ echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc | |
92 | $ echo "[ui]" >> .hg/hgrc |
|
92 | $ echo "[ui]" >> .hg/hgrc | |
93 | $ echo "ssh = python \"$TESTDIR/dummyssh\"" >> .hg/hgrc |
|
93 | $ echo "ssh = python \"$TESTDIR/dummyssh\"" >> .hg/hgrc | |
94 |
|
94 | |||
95 | find outgoing |
|
95 | find outgoing | |
96 |
|
96 | |||
97 | $ hg out ssh://user@dummy/remote |
|
97 | $ hg out ssh://user@dummy/remote | |
98 | comparing with ssh://user@dummy/remote |
|
98 | comparing with ssh://user@dummy/remote | |
99 | searching for changes |
|
99 | searching for changes | |
100 | changeset: 1:a28a9d1a809c |
|
100 | changeset: 1:a28a9d1a809c | |
101 | tag: tip |
|
101 | tag: tip | |
102 | user: test |
|
102 | user: test | |
103 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
103 | date: Thu Jan 01 00:00:00 1970 +0000 | |
104 | summary: add |
|
104 | summary: add | |
105 |
|
105 | |||
106 |
|
106 | |||
107 | find incoming on the remote side |
|
107 | find incoming on the remote side | |
108 |
|
108 | |||
109 | $ hg incoming -R ../remote -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/local |
|
109 | $ hg incoming -R ../remote -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/local | |
110 | comparing with ssh://user@dummy/local |
|
110 | comparing with ssh://user@dummy/local | |
111 | searching for changes |
|
111 | searching for changes | |
112 | changeset: 1:a28a9d1a809c |
|
112 | changeset: 1:a28a9d1a809c | |
113 | tag: tip |
|
113 | tag: tip | |
114 | user: test |
|
114 | user: test | |
115 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
115 | date: Thu Jan 01 00:00:00 1970 +0000 | |
116 | summary: add |
|
116 | summary: add | |
117 |
|
117 | |||
118 |
|
118 | |||
119 | find incoming on the remote side (using absolute path) |
|
119 | find incoming on the remote side (using absolute path) | |
120 |
|
120 | |||
121 | $ hg incoming -R ../remote -e "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/`pwd`" |
|
121 | $ hg incoming -R ../remote -e "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/`pwd`" | |
122 | comparing with ssh://user@dummy/$TESTTMP/local |
|
122 | comparing with ssh://user@dummy/$TESTTMP/local | |
123 | searching for changes |
|
123 | searching for changes | |
124 | changeset: 1:a28a9d1a809c |
|
124 | changeset: 1:a28a9d1a809c | |
125 | tag: tip |
|
125 | tag: tip | |
126 | user: test |
|
126 | user: test | |
127 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
127 | date: Thu Jan 01 00:00:00 1970 +0000 | |
128 | summary: add |
|
128 | summary: add | |
129 |
|
129 | |||
130 |
|
130 | |||
131 | push |
|
131 | push | |
132 |
|
132 | |||
133 | $ hg push |
|
133 | $ hg push | |
134 | pushing to ssh://user@dummy/remote |
|
134 | pushing to ssh://user@dummy/remote | |
135 | searching for changes |
|
135 | searching for changes | |
136 | remote: adding changesets |
|
136 | remote: adding changesets | |
137 | remote: adding manifests |
|
137 | remote: adding manifests | |
138 | remote: adding file changes |
|
138 | remote: adding file changes | |
139 | remote: added 1 changesets with 1 changes to 1 files |
|
139 | remote: added 1 changesets with 1 changes to 1 files | |
140 | $ cd ../remote |
|
140 | $ cd ../remote | |
141 |
|
141 | |||
142 | check remote tip |
|
142 | check remote tip | |
143 |
|
143 | |||
144 | $ hg tip |
|
144 | $ hg tip | |
145 | changeset: 1:a28a9d1a809c |
|
145 | changeset: 1:a28a9d1a809c | |
146 | tag: tip |
|
146 | tag: tip | |
147 | user: test |
|
147 | user: test | |
148 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
148 | date: Thu Jan 01 00:00:00 1970 +0000 | |
149 | summary: add |
|
149 | summary: add | |
150 |
|
150 | |||
151 | $ hg verify |
|
151 | $ hg verify | |
152 | checking changesets |
|
152 | checking changesets | |
153 | checking manifests |
|
153 | checking manifests | |
154 | crosschecking files in changesets and manifests |
|
154 | crosschecking files in changesets and manifests | |
155 | checking files |
|
155 | checking files | |
156 | 2 files, 2 changesets, 3 total revisions |
|
156 | 2 files, 2 changesets, 3 total revisions | |
157 | $ hg cat -r tip foo |
|
157 | $ hg cat -r tip foo | |
158 | bleah |
|
158 | bleah | |
159 | $ echo z > z |
|
159 | $ echo z > z | |
160 | $ hg ci -A -m z z |
|
160 | $ hg ci -A -m z z | |
161 | created new head |
|
161 | created new head | |
162 |
|
162 | |||
163 | test pushkeys and bookmarks |
|
163 | test pushkeys and bookmarks | |
164 |
|
164 | |||
165 | $ cd ../local |
|
165 | $ cd ../local | |
166 | $ hg debugpushkey --config ui.ssh="python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote namespaces |
|
166 | $ hg debugpushkey --config ui.ssh="python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote namespaces | |
167 | bookmarks |
|
167 | bookmarks | |
168 | namespaces |
|
168 | namespaces | |
169 | phases |
|
169 | phases | |
170 | $ hg book foo -r 0 |
|
170 | $ hg book foo -r 0 | |
171 | $ hg out -B |
|
171 | $ hg out -B | |
172 | comparing with ssh://user@dummy/remote |
|
172 | comparing with ssh://user@dummy/remote | |
173 | searching for changed bookmarks |
|
173 | searching for changed bookmarks | |
174 | foo 1160648e36ce |
|
174 | foo 1160648e36ce | |
175 | $ hg push -B foo |
|
175 | $ hg push -B foo | |
176 | pushing to ssh://user@dummy/remote |
|
176 | pushing to ssh://user@dummy/remote | |
177 | searching for changes |
|
177 | searching for changes | |
178 | no changes found |
|
178 | no changes found | |
179 | exporting bookmark foo |
|
179 | exporting bookmark foo | |
180 | [1] |
|
180 | [1] | |
181 | $ hg debugpushkey --config ui.ssh="python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote bookmarks |
|
181 | $ hg debugpushkey --config ui.ssh="python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote bookmarks | |
182 | foo 1160648e36cec0054048a7edc4110c6f84fde594 |
|
182 | foo 1160648e36cec0054048a7edc4110c6f84fde594 | |
183 | $ hg book -f foo |
|
183 | $ hg book -f foo | |
184 | $ hg push --traceback |
|
184 | $ hg push --traceback | |
185 | pushing to ssh://user@dummy/remote |
|
185 | pushing to ssh://user@dummy/remote | |
186 | searching for changes |
|
186 | searching for changes | |
187 | no changes found |
|
187 | no changes found | |
188 | updating bookmark foo |
|
188 | updating bookmark foo | |
189 | [1] |
|
189 | [1] | |
190 | $ hg book -d foo |
|
190 | $ hg book -d foo | |
191 | $ hg in -B |
|
191 | $ hg in -B | |
192 | comparing with ssh://user@dummy/remote |
|
192 | comparing with ssh://user@dummy/remote | |
193 | searching for changed bookmarks |
|
193 | searching for changed bookmarks | |
194 | foo a28a9d1a809c |
|
194 | foo a28a9d1a809c | |
195 | $ hg book -f -r 0 foo |
|
195 | $ hg book -f -r 0 foo | |
196 | $ hg pull -B foo |
|
196 | $ hg pull -B foo | |
197 | pulling from ssh://user@dummy/remote |
|
197 | pulling from ssh://user@dummy/remote | |
198 | no changes found |
|
198 | no changes found | |
199 | updating bookmark foo |
|
199 | updating bookmark foo | |
200 | importing bookmark foo |
|
200 | importing bookmark foo | |
201 | $ hg book -d foo |
|
201 | $ hg book -d foo | |
202 | $ hg push -B foo |
|
202 | $ hg push -B foo | |
203 | pushing to ssh://user@dummy/remote |
|
203 | pushing to ssh://user@dummy/remote | |
204 | searching for changes |
|
204 | searching for changes | |
205 | no changes found |
|
205 | no changes found | |
206 | deleting remote bookmark foo |
|
206 | deleting remote bookmark foo | |
207 | [1] |
|
207 | [1] | |
208 |
|
208 | |||
209 | a bad, evil hook that prints to stdout |
|
209 | a bad, evil hook that prints to stdout | |
210 |
|
210 | |||
211 | $ cat <<EOF > $TESTTMP/badhook |
|
211 | $ cat <<EOF > $TESTTMP/badhook | |
212 | > import sys |
|
212 | > import sys | |
213 | > sys.stdout.write("KABOOM\n") |
|
213 | > sys.stdout.write("KABOOM\n") | |
214 | > EOF |
|
214 | > EOF | |
215 |
|
215 | |||
216 | $ echo '[hooks]' >> ../remote/.hg/hgrc |
|
216 | $ echo '[hooks]' >> ../remote/.hg/hgrc | |
217 | $ echo "changegroup.stdout = python $TESTTMP/badhook" >> ../remote/.hg/hgrc |
|
217 | $ echo "changegroup.stdout = python $TESTTMP/badhook" >> ../remote/.hg/hgrc | |
218 | $ echo r > r |
|
218 | $ echo r > r | |
219 | $ hg ci -A -m z r |
|
219 | $ hg ci -A -m z r | |
220 |
|
220 | |||
221 | push should succeed even though it has an unexpected response |
|
221 | push should succeed even though it has an unexpected response | |
222 |
|
222 | |||
223 | $ hg push |
|
223 | $ hg push | |
224 | pushing to ssh://user@dummy/remote |
|
224 | pushing to ssh://user@dummy/remote | |
225 | searching for changes |
|
225 | searching for changes | |
226 | remote has heads on branch 'default' that are not known locally: 6c0482d977a3 |
|
226 | remote has heads on branch 'default' that are not known locally: 6c0482d977a3 | |
227 | remote: adding changesets |
|
227 | remote: adding changesets | |
228 | remote: adding manifests |
|
228 | remote: adding manifests | |
229 | remote: adding file changes |
|
229 | remote: adding file changes | |
230 | remote: added 1 changesets with 1 changes to 1 files |
|
230 | remote: added 1 changesets with 1 changes to 1 files | |
231 | remote: KABOOM |
|
231 | remote: KABOOM | |
232 | $ hg -R ../remote heads |
|
232 | $ hg -R ../remote heads | |
233 | changeset: 3:1383141674ec |
|
233 | changeset: 3:1383141674ec | |
234 | tag: tip |
|
234 | tag: tip | |
235 | parent: 1:a28a9d1a809c |
|
235 | parent: 1:a28a9d1a809c | |
236 | user: test |
|
236 | user: test | |
237 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
237 | date: Thu Jan 01 00:00:00 1970 +0000 | |
238 | summary: z |
|
238 | summary: z | |
239 |
|
239 | |||
240 | changeset: 2:6c0482d977a3 |
|
240 | changeset: 2:6c0482d977a3 | |
241 | parent: 0:1160648e36ce |
|
241 | parent: 0:1160648e36ce | |
242 | user: test |
|
242 | user: test | |
243 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
243 | date: Thu Jan 01 00:00:00 1970 +0000 | |
244 | summary: z |
|
244 | summary: z | |
245 |
|
245 | |||
246 |
|
246 | |||
247 | clone bookmarks |
|
247 | clone bookmarks | |
248 |
|
248 | |||
249 | $ hg -R ../remote bookmark test |
|
249 | $ hg -R ../remote bookmark test | |
250 | $ hg -R ../remote bookmarks |
|
250 | $ hg -R ../remote bookmarks | |
251 | * test 2:6c0482d977a3 |
|
251 | * test 2:6c0482d977a3 | |
252 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local-bookmarks |
|
252 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local-bookmarks | |
253 | requesting all changes |
|
253 | requesting all changes | |
254 | adding changesets |
|
254 | adding changesets | |
255 | adding manifests |
|
255 | adding manifests | |
256 | adding file changes |
|
256 | adding file changes | |
257 | added 4 changesets with 5 changes to 4 files (+1 heads) |
|
257 | added 4 changesets with 5 changes to 4 files (+1 heads) | |
258 | updating to branch default |
|
258 | updating to branch default | |
259 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
259 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
260 | $ hg -R local-bookmarks bookmarks |
|
260 | $ hg -R local-bookmarks bookmarks | |
261 | test 2:6c0482d977a3 |
|
261 | test 2:6c0482d977a3 | |
262 |
|
262 | |||
263 | passwords in ssh urls are not supported |
|
263 | passwords in ssh urls are not supported | |
264 | (we use a glob here because different Python versions give different |
|
264 | (we use a glob here because different Python versions give different | |
265 | results here) |
|
265 | results here) | |
266 |
|
266 | |||
267 | $ hg push ssh://user:erroneouspwd@dummy/remote |
|
267 | $ hg push ssh://user:erroneouspwd@dummy/remote | |
268 | pushing to ssh://user:*@dummy/remote (glob) |
|
268 | pushing to ssh://user:*@dummy/remote (glob) | |
269 | abort: password in URL not supported! |
|
269 | abort: password in URL not supported! | |
270 | [255] |
|
270 | [255] | |
271 |
|
271 | |||
272 | $ cd .. |
|
272 | $ cd .. | |
273 |
|
273 | |||
274 | hide outer repo |
|
274 | hide outer repo | |
275 | $ hg init |
|
275 | $ hg init | |
276 |
|
276 | |||
277 | Test remote paths with spaces (issue2983): |
|
277 | Test remote paths with spaces (issue2983): | |
278 |
|
278 | |||
279 | $ hg init --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo" |
|
279 | $ hg init --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo" | |
280 | $ touch "$TESTTMP/a repo/test" |
|
280 | $ touch "$TESTTMP/a repo/test" | |
281 | $ hg -R 'a repo' commit -A -m "test" |
|
281 | $ hg -R 'a repo' commit -A -m "test" | |
282 | adding test |
|
282 | adding test | |
283 | $ hg -R 'a repo' tag tag |
|
283 | $ hg -R 'a repo' tag tag | |
284 | $ hg id --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo" |
|
284 | $ hg id --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo" | |
285 | 73649e48688a |
|
285 | 73649e48688a | |
286 |
|
286 | |||
287 | $ hg id --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo#noNoNO" |
|
287 | $ hg id --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo#noNoNO" | |
288 | abort: unknown revision 'noNoNO'! |
|
288 | abort: unknown revision 'noNoNO'! | |
289 | [255] |
|
289 | [255] | |
290 |
|
290 | |||
291 | Test (non-)escaping of remote paths with spaces when cloning (issue3145): |
|
291 | Test (non-)escaping of remote paths with spaces when cloning (issue3145): | |
292 |
|
292 | |||
293 | $ hg clone --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo" |
|
293 | $ hg clone --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo" | |
294 | destination directory: a repo |
|
294 | destination directory: a repo | |
295 | abort: destination 'a repo' is not empty |
|
295 | abort: destination 'a repo' is not empty | |
296 | [255] |
|
296 | [255] | |
297 |
|
297 | |||
298 | Test hg-ssh using a helper script that will restore PYTHONPATH (which might |
|
298 | Test hg-ssh using a helper script that will restore PYTHONPATH (which might | |
299 | have been cleared by a hg.exe wrapper) and invoke hg-ssh with the right |
|
299 | have been cleared by a hg.exe wrapper) and invoke hg-ssh with the right | |
300 | parameters: |
|
300 | parameters: | |
301 |
|
301 | |||
302 | $ cat > ssh.sh << EOF |
|
302 | $ cat > ssh.sh << EOF | |
303 | > userhost="\$1" |
|
303 | > userhost="\$1" | |
304 | > SSH_ORIGINAL_COMMAND="\$2" |
|
304 | > SSH_ORIGINAL_COMMAND="\$2" | |
305 | > export SSH_ORIGINAL_COMMAND |
|
305 | > export SSH_ORIGINAL_COMMAND | |
306 | > PYTHONPATH="$PYTHONPATH" |
|
306 | > PYTHONPATH="$PYTHONPATH" | |
307 | > export PYTHONPATH |
|
307 | > export PYTHONPATH | |
308 | > python "$TESTDIR/../contrib/hg-ssh" "$TESTTMP/a repo" |
|
308 | > python "$TESTDIR/../contrib/hg-ssh" "$TESTTMP/a repo" | |
309 | > EOF |
|
309 | > EOF | |
310 |
|
310 | |||
311 | $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a repo" |
|
311 | $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a repo" | |
312 | 73649e48688a |
|
312 | 73649e48688a | |
313 |
|
313 | |||
314 | $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a'repo" |
|
314 | $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a'repo" | |
315 | remote: Illegal repository "$TESTTMP/a'repo" (glob) |
|
315 | remote: Illegal repository "$TESTTMP/a'repo" (glob) | |
316 | abort: no suitable response from remote hg! |
|
316 | abort: no suitable response from remote hg! | |
317 | [255] |
|
317 | [255] | |
318 |
|
318 | |||
319 | $ hg id --ssh "sh ssh.sh" --remotecmd hacking "ssh://user@dummy/a'repo" |
|
319 | $ hg id --ssh "sh ssh.sh" --remotecmd hacking "ssh://user@dummy/a'repo" | |
320 | remote: Illegal command "hacking -R 'a'\''repo' serve --stdio" |
|
320 | remote: Illegal command "hacking -R 'a'\''repo' serve --stdio" | |
321 | abort: no suitable response from remote hg! |
|
321 | abort: no suitable response from remote hg! | |
322 | [255] |
|
322 | [255] | |
323 |
|
323 | |||
324 | $ SSH_ORIGINAL_COMMAND="'hg' -R 'a'repo' serve --stdio" python "$TESTDIR/../contrib/hg-ssh" |
|
324 | $ SSH_ORIGINAL_COMMAND="'hg' -R 'a'repo' serve --stdio" python "$TESTDIR/../contrib/hg-ssh" | |
325 | Illegal command "'hg' -R 'a'repo' serve --stdio": No closing quotation |
|
325 | Illegal command "'hg' -R 'a'repo' serve --stdio": No closing quotation | |
326 | [255] |
|
326 | [255] | |
327 |
|
327 | |||
328 | Test hg-ssh in read-only mode: |
|
328 | Test hg-ssh in read-only mode: | |
329 |
|
329 | |||
330 | $ cat > ssh.sh << EOF |
|
330 | $ cat > ssh.sh << EOF | |
331 | > userhost="\$1" |
|
331 | > userhost="\$1" | |
332 | > SSH_ORIGINAL_COMMAND="\$2" |
|
332 | > SSH_ORIGINAL_COMMAND="\$2" | |
333 | > export SSH_ORIGINAL_COMMAND |
|
333 | > export SSH_ORIGINAL_COMMAND | |
334 | > PYTHONPATH="$PYTHONPATH" |
|
334 | > PYTHONPATH="$PYTHONPATH" | |
335 | > export PYTHONPATH |
|
335 | > export PYTHONPATH | |
336 | > python "$TESTDIR/../contrib/hg-ssh" --read-only "$TESTTMP/remote" |
|
336 | > python "$TESTDIR/../contrib/hg-ssh" --read-only "$TESTTMP/remote" | |
337 | > EOF |
|
337 | > EOF | |
338 |
|
338 | |||
339 | $ hg clone --ssh "sh ssh.sh" "ssh://user@dummy/$TESTTMP/remote" read-only-local |
|
339 | $ hg clone --ssh "sh ssh.sh" "ssh://user@dummy/$TESTTMP/remote" read-only-local | |
340 | requesting all changes |
|
340 | requesting all changes | |
341 | adding changesets |
|
341 | adding changesets | |
342 | adding manifests |
|
342 | adding manifests | |
343 | adding file changes |
|
343 | adding file changes | |
344 | added 4 changesets with 5 changes to 4 files (+1 heads) |
|
344 | added 4 changesets with 5 changes to 4 files (+1 heads) | |
345 | updating to branch default |
|
345 | updating to branch default | |
346 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
346 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
347 |
|
347 | |||
348 | $ cd read-only-local |
|
348 | $ cd read-only-local | |
349 | $ echo "baz" > bar |
|
349 | $ echo "baz" > bar | |
350 | $ hg ci -A -m "unpushable commit" bar |
|
350 | $ hg ci -A -m "unpushable commit" bar | |
351 | $ hg push --ssh "sh ../ssh.sh" |
|
351 | $ hg push --ssh "sh ../ssh.sh" | |
352 | pushing to ssh://user@dummy/*/remote (glob) |
|
352 | pushing to ssh://user@dummy/*/remote (glob) | |
353 | searching for changes |
|
353 | searching for changes | |
354 | remote: Permission denied |
|
354 | remote: Permission denied | |
355 | remote: abort: prechangegroup.hg-ssh hook failed |
|
355 | remote: abort: prechangegroup.hg-ssh hook failed | |
356 | remote: Permission denied |
|
356 | remote: Permission denied | |
357 | remote: abort: prepushkey.hg-ssh hook failed |
|
357 | remote: abort: prepushkey.hg-ssh hook failed | |
358 | abort: unexpected response: empty string |
|
358 | abort: unexpected response: empty string | |
359 | [255] |
|
359 | [255] | |
360 |
|
360 | |||
361 | $ cd .. |
|
361 | $ cd .. | |
362 |
|
362 | |||
|
363 | stderr from remote commands should be printed before stdout from local code (issue4336) | |||
|
364 | ||||
|
365 | $ hg clone remote stderr-ordering | |||
|
366 | updating to branch default | |||
|
367 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
368 | $ cd stderr-ordering | |||
|
369 | $ cat >> localwrite.py << EOF | |||
|
370 | > from mercurial import exchange, extensions | |||
|
371 | > | |||
|
372 | > def wrappedpush(orig, repo, *args, **kwargs): | |||
|
373 | > res = orig(repo, *args, **kwargs) | |||
|
374 | > repo.ui.write('local stdout\n') | |||
|
375 | > return res | |||
|
376 | > | |||
|
377 | > def extsetup(ui): | |||
|
378 | > extensions.wrapfunction(exchange, 'push', wrappedpush) | |||
|
379 | > EOF | |||
|
380 | ||||
|
381 | $ cat >> .hg/hgrc << EOF | |||
|
382 | > [paths] | |||
|
383 | > default-push = ssh://user@dummy/remote | |||
|
384 | > [ui] | |||
|
385 | > ssh = python "$TESTDIR/dummyssh" | |||
|
386 | > [extensions] | |||
|
387 | > localwrite = localwrite.py | |||
|
388 | > EOF | |||
|
389 | ||||
|
390 | $ echo localwrite > foo | |||
|
391 | $ hg commit -m 'testing localwrite' | |||
|
392 | $ hg push | |||
|
393 | pushing to ssh://user@dummy/remote | |||
|
394 | searching for changes | |||
|
395 | remote: adding changesets | |||
|
396 | remote: adding manifests | |||
|
397 | remote: adding file changes | |||
|
398 | remote: added 1 changesets with 1 changes to 1 files | |||
|
399 | remote: KABOOM | |||
|
400 | local stdout | |||
|
401 | ||||
|
402 | $ cd .. | |||
|
403 | ||||
363 | $ cat dummylog |
|
404 | $ cat dummylog | |
364 | Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio |
|
405 | Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio | |
365 | Got arguments 1:user@dummy 2:hg -R /$TESTTMP/nonexistent serve --stdio |
|
406 | Got arguments 1:user@dummy 2:hg -R /$TESTTMP/nonexistent serve --stdio | |
366 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
407 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
367 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
408 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
368 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
409 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
369 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
410 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
370 | Got arguments 1:user@dummy 2:hg -R local serve --stdio |
|
411 | Got arguments 1:user@dummy 2:hg -R local serve --stdio | |
371 | Got arguments 1:user@dummy 2:hg -R $TESTTMP/local serve --stdio |
|
412 | Got arguments 1:user@dummy 2:hg -R $TESTTMP/local serve --stdio | |
372 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
413 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
373 | changegroup-in-remote hook: HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1 |
|
414 | changegroup-in-remote hook: HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1 | |
374 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
415 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
375 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
416 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
376 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
417 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
377 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
418 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
378 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
419 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
379 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
420 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
380 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
421 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
381 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
422 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
382 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
423 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
383 | changegroup-in-remote hook: HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6 HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1 |
|
424 | changegroup-in-remote hook: HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6 HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1 | |
384 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
425 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
385 | Got arguments 1:user@dummy 2:hg init 'a repo' |
|
426 | Got arguments 1:user@dummy 2:hg init 'a repo' | |
386 | Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio |
|
427 | Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio | |
387 | Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio |
|
428 | Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio | |
388 | Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio |
|
429 | Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio | |
389 | Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio |
|
430 | Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio | |
|
431 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |||
|
432 | changegroup-in-remote hook: HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1 |
General Comments 0
You need to be logged in to leave comments.
Login now