Show More
@@ -1,333 +1,333 b'' | |||||
1 | #require serve |
|
1 | #require serve | |
2 |
|
2 | |||
3 | This test is a duplicate of 'test-http.t', feel free to factor out |
|
3 | This test is a duplicate of 'test-http.t', feel free to factor out | |
4 | parts that are not bundle1/bundle2 specific. |
|
4 | parts that are not bundle1/bundle2 specific. | |
5 |
|
5 | |||
6 | $ cat << EOF >> $HGRCPATH |
|
6 | $ cat << EOF >> $HGRCPATH | |
7 |
> [ |
|
7 | > [devel] | |
8 | > # This test is dedicated to interaction through old bundle |
|
8 | > # This test is dedicated to interaction through old bundle | |
9 | > bundle2-exp = False |
|
9 | > legacy.exchange = bundle1 | |
10 | > EOF |
|
10 | > EOF | |
11 |
|
11 | |||
12 | $ hg init test |
|
12 | $ hg init test | |
13 | $ cd test |
|
13 | $ cd test | |
14 | $ echo foo>foo |
|
14 | $ echo foo>foo | |
15 | $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg |
|
15 | $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg | |
16 | $ echo foo>foo.d/foo |
|
16 | $ echo foo>foo.d/foo | |
17 | $ echo bar>foo.d/bAr.hg.d/BaR |
|
17 | $ echo bar>foo.d/bAr.hg.d/BaR | |
18 | $ echo bar>foo.d/baR.d.hg/bAR |
|
18 | $ echo bar>foo.d/baR.d.hg/bAR | |
19 | $ hg commit -A -m 1 |
|
19 | $ hg commit -A -m 1 | |
20 | adding foo |
|
20 | adding foo | |
21 | adding foo.d/bAr.hg.d/BaR |
|
21 | adding foo.d/bAr.hg.d/BaR | |
22 | adding foo.d/baR.d.hg/bAR |
|
22 | adding foo.d/baR.d.hg/bAR | |
23 | adding foo.d/foo |
|
23 | adding foo.d/foo | |
24 | $ hg serve -p $HGPORT -d --pid-file=../hg1.pid -E ../error.log |
|
24 | $ hg serve -p $HGPORT -d --pid-file=../hg1.pid -E ../error.log | |
25 | $ hg serve --config server.uncompressed=False -p $HGPORT1 -d --pid-file=../hg2.pid |
|
25 | $ hg serve --config server.uncompressed=False -p $HGPORT1 -d --pid-file=../hg2.pid | |
26 |
|
26 | |||
27 | Test server address cannot be reused |
|
27 | Test server address cannot be reused | |
28 |
|
28 | |||
29 | #if windows |
|
29 | #if windows | |
30 | $ hg serve -p $HGPORT1 2>&1 |
|
30 | $ hg serve -p $HGPORT1 2>&1 | |
31 | abort: cannot start server at ':$HGPORT1': * (glob) |
|
31 | abort: cannot start server at ':$HGPORT1': * (glob) | |
32 | [255] |
|
32 | [255] | |
33 | #else |
|
33 | #else | |
34 | $ hg serve -p $HGPORT1 2>&1 |
|
34 | $ hg serve -p $HGPORT1 2>&1 | |
35 | abort: cannot start server at ':$HGPORT1': Address already in use |
|
35 | abort: cannot start server at ':$HGPORT1': Address already in use | |
36 | [255] |
|
36 | [255] | |
37 | #endif |
|
37 | #endif | |
38 | $ cd .. |
|
38 | $ cd .. | |
39 | $ cat hg1.pid hg2.pid >> $DAEMON_PIDS |
|
39 | $ cat hg1.pid hg2.pid >> $DAEMON_PIDS | |
40 |
|
40 | |||
41 | clone via stream |
|
41 | clone via stream | |
42 |
|
42 | |||
43 | $ hg clone --uncompressed http://localhost:$HGPORT/ copy 2>&1 |
|
43 | $ hg clone --uncompressed http://localhost:$HGPORT/ copy 2>&1 | |
44 | streaming all changes |
|
44 | streaming all changes | |
45 | 6 files to transfer, 606 bytes of data |
|
45 | 6 files to transfer, 606 bytes of data | |
46 | transferred * bytes in * seconds (*/sec) (glob) |
|
46 | transferred * bytes in * seconds (*/sec) (glob) | |
47 | searching for changes |
|
47 | searching for changes | |
48 | no changes found |
|
48 | no changes found | |
49 | updating to branch default |
|
49 | updating to branch default | |
50 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
50 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
51 | $ hg verify -R copy |
|
51 | $ hg verify -R copy | |
52 | checking changesets |
|
52 | checking changesets | |
53 | checking manifests |
|
53 | checking manifests | |
54 | crosschecking files in changesets and manifests |
|
54 | crosschecking files in changesets and manifests | |
55 | checking files |
|
55 | checking files | |
56 | 4 files, 1 changesets, 4 total revisions |
|
56 | 4 files, 1 changesets, 4 total revisions | |
57 |
|
57 | |||
58 | try to clone via stream, should use pull instead |
|
58 | try to clone via stream, should use pull instead | |
59 |
|
59 | |||
60 | $ hg clone --uncompressed http://localhost:$HGPORT1/ copy2 |
|
60 | $ hg clone --uncompressed http://localhost:$HGPORT1/ copy2 | |
61 | requesting all changes |
|
61 | requesting all changes | |
62 | adding changesets |
|
62 | adding changesets | |
63 | adding manifests |
|
63 | adding manifests | |
64 | adding file changes |
|
64 | adding file changes | |
65 | added 1 changesets with 4 changes to 4 files |
|
65 | added 1 changesets with 4 changes to 4 files | |
66 | updating to branch default |
|
66 | updating to branch default | |
67 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
67 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
68 |
|
68 | |||
69 | clone via pull |
|
69 | clone via pull | |
70 |
|
70 | |||
71 | $ hg clone http://localhost:$HGPORT1/ copy-pull |
|
71 | $ hg clone http://localhost:$HGPORT1/ copy-pull | |
72 | requesting all changes |
|
72 | requesting all changes | |
73 | adding changesets |
|
73 | adding changesets | |
74 | adding manifests |
|
74 | adding manifests | |
75 | adding file changes |
|
75 | adding file changes | |
76 | added 1 changesets with 4 changes to 4 files |
|
76 | added 1 changesets with 4 changes to 4 files | |
77 | updating to branch default |
|
77 | updating to branch default | |
78 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
78 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
79 | $ hg verify -R copy-pull |
|
79 | $ hg verify -R copy-pull | |
80 | checking changesets |
|
80 | checking changesets | |
81 | checking manifests |
|
81 | checking manifests | |
82 | crosschecking files in changesets and manifests |
|
82 | crosschecking files in changesets and manifests | |
83 | checking files |
|
83 | checking files | |
84 | 4 files, 1 changesets, 4 total revisions |
|
84 | 4 files, 1 changesets, 4 total revisions | |
85 | $ cd test |
|
85 | $ cd test | |
86 | $ echo bar > bar |
|
86 | $ echo bar > bar | |
87 | $ hg commit -A -d '1 0' -m 2 |
|
87 | $ hg commit -A -d '1 0' -m 2 | |
88 | adding bar |
|
88 | adding bar | |
89 | $ cd .. |
|
89 | $ cd .. | |
90 |
|
90 | |||
91 | clone over http with --update |
|
91 | clone over http with --update | |
92 |
|
92 | |||
93 | $ hg clone http://localhost:$HGPORT1/ updated --update 0 |
|
93 | $ hg clone http://localhost:$HGPORT1/ updated --update 0 | |
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 2 changesets with 5 changes to 5 files |
|
98 | added 2 changesets with 5 changes to 5 files | |
99 | updating to branch default |
|
99 | updating to branch default | |
100 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
100 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
101 | $ hg log -r . -R updated |
|
101 | $ hg log -r . -R updated | |
102 | changeset: 0:8b6053c928fe |
|
102 | changeset: 0:8b6053c928fe | |
103 | user: test |
|
103 | user: test | |
104 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
104 | date: Thu Jan 01 00:00:00 1970 +0000 | |
105 | summary: 1 |
|
105 | summary: 1 | |
106 |
|
106 | |||
107 | $ rm -rf updated |
|
107 | $ rm -rf updated | |
108 |
|
108 | |||
109 | incoming via HTTP |
|
109 | incoming via HTTP | |
110 |
|
110 | |||
111 | $ hg clone http://localhost:$HGPORT1/ --rev 0 partial |
|
111 | $ hg clone http://localhost:$HGPORT1/ --rev 0 partial | |
112 | adding changesets |
|
112 | adding changesets | |
113 | adding manifests |
|
113 | adding manifests | |
114 | adding file changes |
|
114 | adding file changes | |
115 | added 1 changesets with 4 changes to 4 files |
|
115 | added 1 changesets with 4 changes to 4 files | |
116 | updating to branch default |
|
116 | updating to branch default | |
117 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
117 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
118 | $ cd partial |
|
118 | $ cd partial | |
119 | $ touch LOCAL |
|
119 | $ touch LOCAL | |
120 | $ hg ci -qAm LOCAL |
|
120 | $ hg ci -qAm LOCAL | |
121 | $ hg incoming http://localhost:$HGPORT1/ --template '{desc}\n' |
|
121 | $ hg incoming http://localhost:$HGPORT1/ --template '{desc}\n' | |
122 | comparing with http://localhost:$HGPORT1/ |
|
122 | comparing with http://localhost:$HGPORT1/ | |
123 | searching for changes |
|
123 | searching for changes | |
124 | 2 |
|
124 | 2 | |
125 | $ cd .. |
|
125 | $ cd .. | |
126 |
|
126 | |||
127 | pull |
|
127 | pull | |
128 |
|
128 | |||
129 | $ cd copy-pull |
|
129 | $ cd copy-pull | |
130 | $ echo '[hooks]' >> .hg/hgrc |
|
130 | $ echo '[hooks]' >> .hg/hgrc | |
131 | $ echo "changegroup = printenv.py changegroup" >> .hg/hgrc |
|
131 | $ echo "changegroup = printenv.py changegroup" >> .hg/hgrc | |
132 | $ hg pull |
|
132 | $ hg pull | |
133 | pulling from http://localhost:$HGPORT1/ |
|
133 | pulling from http://localhost:$HGPORT1/ | |
134 | searching for changes |
|
134 | searching for changes | |
135 | adding changesets |
|
135 | adding changesets | |
136 | adding manifests |
|
136 | adding manifests | |
137 | adding file changes |
|
137 | adding file changes | |
138 | added 1 changesets with 1 changes to 1 files |
|
138 | added 1 changesets with 1 changes to 1 files | |
139 | changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=http://localhost:$HGPORT1/ (glob) |
|
139 | changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=http://localhost:$HGPORT1/ (glob) | |
140 | (run 'hg update' to get a working copy) |
|
140 | (run 'hg update' to get a working copy) | |
141 | $ cd .. |
|
141 | $ cd .. | |
142 |
|
142 | |||
143 | clone from invalid URL |
|
143 | clone from invalid URL | |
144 |
|
144 | |||
145 | $ hg clone http://localhost:$HGPORT/bad |
|
145 | $ hg clone http://localhost:$HGPORT/bad | |
146 | abort: HTTP Error 404: Not Found |
|
146 | abort: HTTP Error 404: Not Found | |
147 | [255] |
|
147 | [255] | |
148 |
|
148 | |||
149 | test http authentication |
|
149 | test http authentication | |
150 | + use the same server to test server side streaming preference |
|
150 | + use the same server to test server side streaming preference | |
151 |
|
151 | |||
152 | $ cd test |
|
152 | $ cd test | |
153 | $ cat << EOT > userpass.py |
|
153 | $ cat << EOT > userpass.py | |
154 | > import base64 |
|
154 | > import base64 | |
155 | > from mercurial.hgweb import common |
|
155 | > from mercurial.hgweb import common | |
156 | > def perform_authentication(hgweb, req, op): |
|
156 | > def perform_authentication(hgweb, req, op): | |
157 | > auth = req.env.get('HTTP_AUTHORIZATION') |
|
157 | > auth = req.env.get('HTTP_AUTHORIZATION') | |
158 | > if not auth: |
|
158 | > if not auth: | |
159 | > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, 'who', |
|
159 | > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, 'who', | |
160 | > [('WWW-Authenticate', 'Basic Realm="mercurial"')]) |
|
160 | > [('WWW-Authenticate', 'Basic Realm="mercurial"')]) | |
161 | > if base64.b64decode(auth.split()[1]).split(':', 1) != ['user', 'pass']: |
|
161 | > if base64.b64decode(auth.split()[1]).split(':', 1) != ['user', 'pass']: | |
162 | > raise common.ErrorResponse(common.HTTP_FORBIDDEN, 'no') |
|
162 | > raise common.ErrorResponse(common.HTTP_FORBIDDEN, 'no') | |
163 | > def extsetup(): |
|
163 | > def extsetup(): | |
164 | > common.permhooks.insert(0, perform_authentication) |
|
164 | > common.permhooks.insert(0, perform_authentication) | |
165 | > EOT |
|
165 | > EOT | |
166 | $ hg serve --config extensions.x=userpass.py -p $HGPORT2 -d --pid-file=pid \ |
|
166 | $ hg serve --config extensions.x=userpass.py -p $HGPORT2 -d --pid-file=pid \ | |
167 | > --config server.preferuncompressed=True \ |
|
167 | > --config server.preferuncompressed=True \ | |
168 | > --config web.push_ssl=False --config web.allow_push=* -A ../access.log |
|
168 | > --config web.push_ssl=False --config web.allow_push=* -A ../access.log | |
169 | $ cat pid >> $DAEMON_PIDS |
|
169 | $ cat pid >> $DAEMON_PIDS | |
170 |
|
170 | |||
171 | $ cat << EOF > get_pass.py |
|
171 | $ cat << EOF > get_pass.py | |
172 | > import getpass |
|
172 | > import getpass | |
173 | > def newgetpass(arg): |
|
173 | > def newgetpass(arg): | |
174 | > return "pass" |
|
174 | > return "pass" | |
175 | > getpass.getpass = newgetpass |
|
175 | > getpass.getpass = newgetpass | |
176 | > EOF |
|
176 | > EOF | |
177 |
|
177 | |||
178 | $ hg id http://localhost:$HGPORT2/ |
|
178 | $ hg id http://localhost:$HGPORT2/ | |
179 | abort: http authorization required for http://localhost:$HGPORT2/ |
|
179 | abort: http authorization required for http://localhost:$HGPORT2/ | |
180 | [255] |
|
180 | [255] | |
181 | $ hg id http://localhost:$HGPORT2/ |
|
181 | $ hg id http://localhost:$HGPORT2/ | |
182 | abort: http authorization required for http://localhost:$HGPORT2/ |
|
182 | abort: http authorization required for http://localhost:$HGPORT2/ | |
183 | [255] |
|
183 | [255] | |
184 | $ hg id --config ui.interactive=true --config extensions.getpass=get_pass.py http://user@localhost:$HGPORT2/ |
|
184 | $ hg id --config ui.interactive=true --config extensions.getpass=get_pass.py http://user@localhost:$HGPORT2/ | |
185 | http authorization required for http://localhost:$HGPORT2/ |
|
185 | http authorization required for http://localhost:$HGPORT2/ | |
186 | realm: mercurial |
|
186 | realm: mercurial | |
187 | user: user |
|
187 | user: user | |
188 | password: 5fed3813f7f5 |
|
188 | password: 5fed3813f7f5 | |
189 | $ hg id http://user:pass@localhost:$HGPORT2/ |
|
189 | $ hg id http://user:pass@localhost:$HGPORT2/ | |
190 | 5fed3813f7f5 |
|
190 | 5fed3813f7f5 | |
191 | $ echo '[auth]' >> .hg/hgrc |
|
191 | $ echo '[auth]' >> .hg/hgrc | |
192 | $ echo 'l.schemes=http' >> .hg/hgrc |
|
192 | $ echo 'l.schemes=http' >> .hg/hgrc | |
193 | $ echo 'l.prefix=lo' >> .hg/hgrc |
|
193 | $ echo 'l.prefix=lo' >> .hg/hgrc | |
194 | $ echo 'l.username=user' >> .hg/hgrc |
|
194 | $ echo 'l.username=user' >> .hg/hgrc | |
195 | $ echo 'l.password=pass' >> .hg/hgrc |
|
195 | $ echo 'l.password=pass' >> .hg/hgrc | |
196 | $ hg id http://localhost:$HGPORT2/ |
|
196 | $ hg id http://localhost:$HGPORT2/ | |
197 | 5fed3813f7f5 |
|
197 | 5fed3813f7f5 | |
198 | $ hg id http://localhost:$HGPORT2/ |
|
198 | $ hg id http://localhost:$HGPORT2/ | |
199 | 5fed3813f7f5 |
|
199 | 5fed3813f7f5 | |
200 | $ hg id http://user@localhost:$HGPORT2/ |
|
200 | $ hg id http://user@localhost:$HGPORT2/ | |
201 | 5fed3813f7f5 |
|
201 | 5fed3813f7f5 | |
202 | $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1 |
|
202 | $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1 | |
203 | streaming all changes |
|
203 | streaming all changes | |
204 | 7 files to transfer, 916 bytes of data |
|
204 | 7 files to transfer, 916 bytes of data | |
205 | transferred * bytes in * seconds (*/sec) (glob) |
|
205 | transferred * bytes in * seconds (*/sec) (glob) | |
206 | searching for changes |
|
206 | searching for changes | |
207 | no changes found |
|
207 | no changes found | |
208 | updating to branch default |
|
208 | updating to branch default | |
209 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
209 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
210 | --pull should override server's preferuncompressed |
|
210 | --pull should override server's preferuncompressed | |
211 | $ hg clone --pull http://user:pass@localhost:$HGPORT2/ dest-pull 2>&1 |
|
211 | $ hg clone --pull http://user:pass@localhost:$HGPORT2/ dest-pull 2>&1 | |
212 | requesting all changes |
|
212 | requesting all changes | |
213 | adding changesets |
|
213 | adding changesets | |
214 | adding manifests |
|
214 | adding manifests | |
215 | adding file changes |
|
215 | adding file changes | |
216 | added 2 changesets with 5 changes to 5 files |
|
216 | added 2 changesets with 5 changes to 5 files | |
217 | updating to branch default |
|
217 | updating to branch default | |
218 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
218 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
219 |
|
219 | |||
220 | $ hg id http://user2@localhost:$HGPORT2/ |
|
220 | $ hg id http://user2@localhost:$HGPORT2/ | |
221 | abort: http authorization required for http://localhost:$HGPORT2/ |
|
221 | abort: http authorization required for http://localhost:$HGPORT2/ | |
222 | [255] |
|
222 | [255] | |
223 | $ hg id http://user:pass2@localhost:$HGPORT2/ |
|
223 | $ hg id http://user:pass2@localhost:$HGPORT2/ | |
224 | abort: HTTP Error 403: no |
|
224 | abort: HTTP Error 403: no | |
225 | [255] |
|
225 | [255] | |
226 |
|
226 | |||
227 | $ hg -R dest tag -r tip top |
|
227 | $ hg -R dest tag -r tip top | |
228 | $ hg -R dest push http://user:pass@localhost:$HGPORT2/ |
|
228 | $ hg -R dest push http://user:pass@localhost:$HGPORT2/ | |
229 | pushing to http://user:***@localhost:$HGPORT2/ |
|
229 | pushing to http://user:***@localhost:$HGPORT2/ | |
230 | searching for changes |
|
230 | searching for changes | |
231 | remote: adding changesets |
|
231 | remote: adding changesets | |
232 | remote: adding manifests |
|
232 | remote: adding manifests | |
233 | remote: adding file changes |
|
233 | remote: adding file changes | |
234 | remote: added 1 changesets with 1 changes to 1 files |
|
234 | remote: added 1 changesets with 1 changes to 1 files | |
235 | $ hg rollback -q |
|
235 | $ hg rollback -q | |
236 |
|
236 | |||
237 | $ sed 's/.*] "/"/' < ../access.log |
|
237 | $ sed 's/.*] "/"/' < ../access.log | |
238 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
238 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
239 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip |
|
239 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip | |
240 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces |
|
240 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces | |
241 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
241 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
242 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip |
|
242 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip | |
243 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces |
|
243 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces | |
244 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
244 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
245 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip |
|
245 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip | |
246 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces |
|
246 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces | |
247 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces |
|
247 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces | |
248 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks |
|
248 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks | |
249 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
249 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
250 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip |
|
250 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip | |
251 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces |
|
251 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces | |
252 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces |
|
252 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces | |
253 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks |
|
253 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks | |
254 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
254 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
255 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip |
|
255 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip | |
256 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces |
|
256 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces | |
257 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces |
|
257 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces | |
258 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks |
|
258 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks | |
259 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
259 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
260 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip |
|
260 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip | |
261 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces |
|
261 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces | |
262 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces |
|
262 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces | |
263 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks |
|
263 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks | |
264 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
264 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
265 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip |
|
265 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip | |
266 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces |
|
266 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces | |
267 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces |
|
267 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces | |
268 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks |
|
268 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks | |
269 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
269 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
270 | "GET /?cmd=branchmap HTTP/1.1" 200 - |
|
270 | "GET /?cmd=branchmap HTTP/1.1" 200 - | |
271 | "GET /?cmd=stream_out HTTP/1.1" 401 - |
|
271 | "GET /?cmd=stream_out HTTP/1.1" 401 - | |
272 | "GET /?cmd=stream_out HTTP/1.1" 200 - |
|
272 | "GET /?cmd=stream_out HTTP/1.1" 200 - | |
273 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks |
|
273 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks | |
274 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D5fed3813f7f5e1824344fdc9cf8f63bb662c292d |
|
274 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D5fed3813f7f5e1824344fdc9cf8f63bb662c292d | |
275 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases |
|
275 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases | |
276 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
276 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
277 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=bookmarks |
|
277 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=bookmarks | |
278 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks |
|
278 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks | |
279 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D |
|
279 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D | |
280 | "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d |
|
280 | "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d | |
281 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases |
|
281 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases | |
282 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
282 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
283 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip |
|
283 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip | |
284 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces |
|
284 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces | |
285 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
285 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
286 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip |
|
286 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip | |
287 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces |
|
287 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces | |
288 | "GET /?cmd=listkeys HTTP/1.1" 403 - x-hgarg-1:namespace=namespaces |
|
288 | "GET /?cmd=listkeys HTTP/1.1" 403 - x-hgarg-1:namespace=namespaces | |
289 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
289 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
290 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 |
|
290 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 | |
291 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=phases |
|
291 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=phases | |
292 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases |
|
292 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases | |
293 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks |
|
293 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks | |
294 | "GET /?cmd=branchmap HTTP/1.1" 200 - |
|
294 | "GET /?cmd=branchmap HTTP/1.1" 200 - | |
295 | "GET /?cmd=branchmap HTTP/1.1" 200 - |
|
295 | "GET /?cmd=branchmap HTTP/1.1" 200 - | |
296 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks |
|
296 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks | |
297 | "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=686173686564+5eb5abfefeea63c80dd7553bcc3783f37e0c5524* (glob) |
|
297 | "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=686173686564+5eb5abfefeea63c80dd7553bcc3783f37e0c5524* (glob) | |
298 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases |
|
298 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases | |
299 |
|
299 | |||
300 | $ cd .. |
|
300 | $ cd .. | |
301 |
|
301 | |||
302 | clone of serve with repo in root and unserved subrepo (issue2970) |
|
302 | clone of serve with repo in root and unserved subrepo (issue2970) | |
303 |
|
303 | |||
304 | $ hg --cwd test init sub |
|
304 | $ hg --cwd test init sub | |
305 | $ echo empty > test/sub/empty |
|
305 | $ echo empty > test/sub/empty | |
306 | $ hg --cwd test/sub add empty |
|
306 | $ hg --cwd test/sub add empty | |
307 | $ hg --cwd test/sub commit -qm 'add empty' |
|
307 | $ hg --cwd test/sub commit -qm 'add empty' | |
308 | $ hg --cwd test/sub tag -r 0 something |
|
308 | $ hg --cwd test/sub tag -r 0 something | |
309 | $ echo sub = sub > test/.hgsub |
|
309 | $ echo sub = sub > test/.hgsub | |
310 | $ hg --cwd test add .hgsub |
|
310 | $ hg --cwd test add .hgsub | |
311 | $ hg --cwd test commit -qm 'add subrepo' |
|
311 | $ hg --cwd test commit -qm 'add subrepo' | |
312 | $ hg clone http://localhost:$HGPORT noslash-clone |
|
312 | $ hg clone http://localhost:$HGPORT noslash-clone | |
313 | requesting all changes |
|
313 | requesting all changes | |
314 | adding changesets |
|
314 | adding changesets | |
315 | adding manifests |
|
315 | adding manifests | |
316 | adding file changes |
|
316 | adding file changes | |
317 | added 3 changesets with 7 changes to 7 files |
|
317 | added 3 changesets with 7 changes to 7 files | |
318 | updating to branch default |
|
318 | updating to branch default | |
319 | abort: HTTP Error 404: Not Found |
|
319 | abort: HTTP Error 404: Not Found | |
320 | [255] |
|
320 | [255] | |
321 | $ hg clone http://localhost:$HGPORT/ slash-clone |
|
321 | $ hg clone http://localhost:$HGPORT/ slash-clone | |
322 | requesting all changes |
|
322 | requesting all changes | |
323 | adding changesets |
|
323 | adding changesets | |
324 | adding manifests |
|
324 | adding manifests | |
325 | adding file changes |
|
325 | adding file changes | |
326 | added 3 changesets with 7 changes to 7 files |
|
326 | added 3 changesets with 7 changes to 7 files | |
327 | updating to branch default |
|
327 | updating to branch default | |
328 | abort: HTTP Error 404: Not Found |
|
328 | abort: HTTP Error 404: Not Found | |
329 | [255] |
|
329 | [255] | |
330 |
|
330 | |||
331 | check error log |
|
331 | check error log | |
332 |
|
332 | |||
333 | $ cat error.log |
|
333 | $ cat error.log |
@@ -1,199 +1,199 b'' | |||||
1 | #require killdaemons |
|
1 | #require killdaemons | |
2 |
|
2 | |||
3 | This test checks behavior related to bundle1 that changed or is likely |
|
3 | This test checks behavior related to bundle1 that changed or is likely | |
4 | to change with bundle2. Feel free to factor out any part of the test |
|
4 | to change with bundle2. Feel free to factor out any part of the test | |
5 | which does not need to exist to keep bundle1 working. |
|
5 | which does not need to exist to keep bundle1 working. | |
6 |
|
6 | |||
7 | $ cat << EOF >> $HGRCPATH |
|
7 | $ cat << EOF >> $HGRCPATH | |
8 |
> [ |
|
8 | > [devel] | |
9 | > # This test is dedicated to interaction through old bundle |
|
9 | > # This test is dedicated to interaction through old bundle | |
10 | > bundle2-exp = False |
|
10 | > legacy.exchange = bundle1 | |
11 | > EOF |
|
11 | > EOF | |
12 |
|
12 | |||
13 | $ hg init test |
|
13 | $ hg init test | |
14 | $ cd test |
|
14 | $ cd test | |
15 | $ echo a > a |
|
15 | $ echo a > a | |
16 | $ hg ci -Ama |
|
16 | $ hg ci -Ama | |
17 | adding a |
|
17 | adding a | |
18 | $ cd .. |
|
18 | $ cd .. | |
19 | $ hg clone test test2 |
|
19 | $ hg clone test test2 | |
20 | updating to branch default |
|
20 | updating to branch default | |
21 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
21 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
22 | $ cd test2 |
|
22 | $ cd test2 | |
23 | $ echo a >> a |
|
23 | $ echo a >> a | |
24 | $ hg ci -mb |
|
24 | $ hg ci -mb | |
25 | $ req() { |
|
25 | $ req() { | |
26 | > hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log |
|
26 | > hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log | |
27 | > cat hg.pid >> $DAEMON_PIDS |
|
27 | > cat hg.pid >> $DAEMON_PIDS | |
28 | > hg --cwd ../test2 push http://localhost:$HGPORT/ |
|
28 | > hg --cwd ../test2 push http://localhost:$HGPORT/ | |
29 | > exitstatus=$? |
|
29 | > exitstatus=$? | |
30 | > killdaemons.py |
|
30 | > killdaemons.py | |
31 | > echo % serve errors |
|
31 | > echo % serve errors | |
32 | > cat errors.log |
|
32 | > cat errors.log | |
33 | > return $exitstatus |
|
33 | > return $exitstatus | |
34 | > } |
|
34 | > } | |
35 | $ cd ../test |
|
35 | $ cd ../test | |
36 |
|
36 | |||
37 | expect ssl error |
|
37 | expect ssl error | |
38 |
|
38 | |||
39 | $ req |
|
39 | $ req | |
40 | pushing to http://localhost:$HGPORT/ |
|
40 | pushing to http://localhost:$HGPORT/ | |
41 | searching for changes |
|
41 | searching for changes | |
42 | abort: HTTP Error 403: ssl required |
|
42 | abort: HTTP Error 403: ssl required | |
43 | % serve errors |
|
43 | % serve errors | |
44 | [255] |
|
44 | [255] | |
45 |
|
45 | |||
46 | expect authorization error |
|
46 | expect authorization error | |
47 |
|
47 | |||
48 | $ echo '[web]' > .hg/hgrc |
|
48 | $ echo '[web]' > .hg/hgrc | |
49 | $ echo 'push_ssl = false' >> .hg/hgrc |
|
49 | $ echo 'push_ssl = false' >> .hg/hgrc | |
50 | $ req |
|
50 | $ req | |
51 | pushing to http://localhost:$HGPORT/ |
|
51 | pushing to http://localhost:$HGPORT/ | |
52 | searching for changes |
|
52 | searching for changes | |
53 | abort: authorization failed |
|
53 | abort: authorization failed | |
54 | % serve errors |
|
54 | % serve errors | |
55 | [255] |
|
55 | [255] | |
56 |
|
56 | |||
57 | expect authorization error: must have authorized user |
|
57 | expect authorization error: must have authorized user | |
58 |
|
58 | |||
59 | $ echo 'allow_push = unperson' >> .hg/hgrc |
|
59 | $ echo 'allow_push = unperson' >> .hg/hgrc | |
60 | $ req |
|
60 | $ req | |
61 | pushing to http://localhost:$HGPORT/ |
|
61 | pushing to http://localhost:$HGPORT/ | |
62 | searching for changes |
|
62 | searching for changes | |
63 | abort: authorization failed |
|
63 | abort: authorization failed | |
64 | % serve errors |
|
64 | % serve errors | |
65 | [255] |
|
65 | [255] | |
66 |
|
66 | |||
67 | expect success |
|
67 | expect success | |
68 |
|
68 | |||
69 | $ echo 'allow_push = *' >> .hg/hgrc |
|
69 | $ echo 'allow_push = *' >> .hg/hgrc | |
70 | $ echo '[hooks]' >> .hg/hgrc |
|
70 | $ echo '[hooks]' >> .hg/hgrc | |
71 | $ echo "changegroup = printenv.py changegroup 0" >> .hg/hgrc |
|
71 | $ echo "changegroup = printenv.py changegroup 0" >> .hg/hgrc | |
72 | $ echo "pushkey = printenv.py pushkey 0" >> .hg/hgrc |
|
72 | $ echo "pushkey = printenv.py pushkey 0" >> .hg/hgrc | |
73 | $ req |
|
73 | $ req | |
74 | pushing to http://localhost:$HGPORT/ |
|
74 | pushing to http://localhost:$HGPORT/ | |
75 | searching for changes |
|
75 | searching for changes | |
76 | remote: adding changesets |
|
76 | remote: adding changesets | |
77 | remote: adding manifests |
|
77 | remote: adding manifests | |
78 | remote: adding file changes |
|
78 | remote: adding file changes | |
79 | remote: added 1 changesets with 1 changes to 1 files |
|
79 | remote: added 1 changesets with 1 changes to 1 files | |
80 | remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:http:127.0.0.1: (glob) |
|
80 | remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:http:127.0.0.1: (glob) | |
81 | % serve errors |
|
81 | % serve errors | |
82 | $ hg rollback |
|
82 | $ hg rollback | |
83 | repository tip rolled back to revision 0 (undo serve) |
|
83 | repository tip rolled back to revision 0 (undo serve) | |
84 |
|
84 | |||
85 | expect success, server lacks the httpheader capability |
|
85 | expect success, server lacks the httpheader capability | |
86 |
|
86 | |||
87 | $ CAP=httpheader |
|
87 | $ CAP=httpheader | |
88 | $ . "$TESTDIR/notcapable" |
|
88 | $ . "$TESTDIR/notcapable" | |
89 | $ req |
|
89 | $ req | |
90 | pushing to http://localhost:$HGPORT/ |
|
90 | pushing to http://localhost:$HGPORT/ | |
91 | searching for changes |
|
91 | searching for changes | |
92 | remote: adding changesets |
|
92 | remote: adding changesets | |
93 | remote: adding manifests |
|
93 | remote: adding manifests | |
94 | remote: adding file changes |
|
94 | remote: adding file changes | |
95 | remote: added 1 changesets with 1 changes to 1 files |
|
95 | remote: added 1 changesets with 1 changes to 1 files | |
96 | remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:http:127.0.0.1: (glob) |
|
96 | remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:http:127.0.0.1: (glob) | |
97 | % serve errors |
|
97 | % serve errors | |
98 | $ hg rollback |
|
98 | $ hg rollback | |
99 | repository tip rolled back to revision 0 (undo serve) |
|
99 | repository tip rolled back to revision 0 (undo serve) | |
100 |
|
100 | |||
101 | expect success, server lacks the unbundlehash capability |
|
101 | expect success, server lacks the unbundlehash capability | |
102 |
|
102 | |||
103 | $ CAP=unbundlehash |
|
103 | $ CAP=unbundlehash | |
104 | $ . "$TESTDIR/notcapable" |
|
104 | $ . "$TESTDIR/notcapable" | |
105 | $ req |
|
105 | $ req | |
106 | pushing to http://localhost:$HGPORT/ |
|
106 | pushing to http://localhost:$HGPORT/ | |
107 | searching for changes |
|
107 | searching for changes | |
108 | remote: adding changesets |
|
108 | remote: adding changesets | |
109 | remote: adding manifests |
|
109 | remote: adding manifests | |
110 | remote: adding file changes |
|
110 | remote: adding file changes | |
111 | remote: added 1 changesets with 1 changes to 1 files |
|
111 | remote: added 1 changesets with 1 changes to 1 files | |
112 | remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:http:127.0.0.1: (glob) |
|
112 | remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:http:127.0.0.1: (glob) | |
113 | % serve errors |
|
113 | % serve errors | |
114 | $ hg rollback |
|
114 | $ hg rollback | |
115 | repository tip rolled back to revision 0 (undo serve) |
|
115 | repository tip rolled back to revision 0 (undo serve) | |
116 |
|
116 | |||
117 | expect success, pre-d1b16a746db6 server supports the unbundle capability, but |
|
117 | expect success, pre-d1b16a746db6 server supports the unbundle capability, but | |
118 | has no parameter |
|
118 | has no parameter | |
119 |
|
119 | |||
120 | $ cat <<EOF > notcapable-unbundleparam.py |
|
120 | $ cat <<EOF > notcapable-unbundleparam.py | |
121 | > from mercurial import extensions, httppeer |
|
121 | > from mercurial import extensions, httppeer | |
122 | > def capable(orig, self, name): |
|
122 | > def capable(orig, self, name): | |
123 | > if name == 'unbundle': |
|
123 | > if name == 'unbundle': | |
124 | > return True |
|
124 | > return True | |
125 | > return orig(self, name) |
|
125 | > return orig(self, name) | |
126 | > def uisetup(ui): |
|
126 | > def uisetup(ui): | |
127 | > extensions.wrapfunction(httppeer.httppeer, 'capable', capable) |
|
127 | > extensions.wrapfunction(httppeer.httppeer, 'capable', capable) | |
128 | > EOF |
|
128 | > EOF | |
129 | $ cp $HGRCPATH $HGRCPATH.orig |
|
129 | $ cp $HGRCPATH $HGRCPATH.orig | |
130 | $ cat <<EOF >> $HGRCPATH |
|
130 | $ cat <<EOF >> $HGRCPATH | |
131 | > [extensions] |
|
131 | > [extensions] | |
132 | > notcapable-unbundleparam = `pwd`/notcapable-unbundleparam.py |
|
132 | > notcapable-unbundleparam = `pwd`/notcapable-unbundleparam.py | |
133 | > EOF |
|
133 | > EOF | |
134 | $ req |
|
134 | $ req | |
135 | pushing to http://localhost:$HGPORT/ |
|
135 | pushing to http://localhost:$HGPORT/ | |
136 | searching for changes |
|
136 | searching for changes | |
137 | remote: adding changesets |
|
137 | remote: adding changesets | |
138 | remote: adding manifests |
|
138 | remote: adding manifests | |
139 | remote: adding file changes |
|
139 | remote: adding file changes | |
140 | remote: added 1 changesets with 1 changes to 1 files |
|
140 | remote: added 1 changesets with 1 changes to 1 files | |
141 | remote: changegroup hook: * (glob) |
|
141 | remote: changegroup hook: * (glob) | |
142 | % serve errors |
|
142 | % serve errors | |
143 | $ hg rollback |
|
143 | $ hg rollback | |
144 | repository tip rolled back to revision 0 (undo serve) |
|
144 | repository tip rolled back to revision 0 (undo serve) | |
145 | $ mv $HGRCPATH.orig $HGRCPATH |
|
145 | $ mv $HGRCPATH.orig $HGRCPATH | |
146 |
|
146 | |||
147 | expect push success, phase change failure |
|
147 | expect push success, phase change failure | |
148 |
|
148 | |||
149 | $ cat > .hg/hgrc <<EOF |
|
149 | $ cat > .hg/hgrc <<EOF | |
150 | > [web] |
|
150 | > [web] | |
151 | > push_ssl = false |
|
151 | > push_ssl = false | |
152 | > allow_push = * |
|
152 | > allow_push = * | |
153 | > [hooks] |
|
153 | > [hooks] | |
154 | > prepushkey = printenv.py prepushkey 1 |
|
154 | > prepushkey = printenv.py prepushkey 1 | |
155 | > EOF |
|
155 | > EOF | |
156 | $ req |
|
156 | $ req | |
157 | pushing to http://localhost:$HGPORT/ |
|
157 | pushing to http://localhost:$HGPORT/ | |
158 | searching for changes |
|
158 | searching for changes | |
159 | remote: adding changesets |
|
159 | remote: adding changesets | |
160 | remote: adding manifests |
|
160 | remote: adding manifests | |
161 | remote: adding file changes |
|
161 | remote: adding file changes | |
162 | remote: added 1 changesets with 1 changes to 1 files |
|
162 | remote: added 1 changesets with 1 changes to 1 files | |
163 | % serve errors |
|
163 | % serve errors | |
164 |
|
164 | |||
165 | expect phase change success |
|
165 | expect phase change success | |
166 |
|
166 | |||
167 | $ echo "prepushkey = printenv.py prepushkey 0" >> .hg/hgrc |
|
167 | $ echo "prepushkey = printenv.py prepushkey 0" >> .hg/hgrc | |
168 | $ req |
|
168 | $ req | |
169 | pushing to http://localhost:$HGPORT/ |
|
169 | pushing to http://localhost:$HGPORT/ | |
170 | searching for changes |
|
170 | searching for changes | |
171 | no changes found |
|
171 | no changes found | |
172 | % serve errors |
|
172 | % serve errors | |
173 | [1] |
|
173 | [1] | |
174 | $ hg rollback |
|
174 | $ hg rollback | |
175 | repository tip rolled back to revision 0 (undo serve) |
|
175 | repository tip rolled back to revision 0 (undo serve) | |
176 |
|
176 | |||
177 | expect authorization error: all users denied |
|
177 | expect authorization error: all users denied | |
178 |
|
178 | |||
179 | $ echo '[web]' > .hg/hgrc |
|
179 | $ echo '[web]' > .hg/hgrc | |
180 | $ echo 'push_ssl = false' >> .hg/hgrc |
|
180 | $ echo 'push_ssl = false' >> .hg/hgrc | |
181 | $ echo 'deny_push = *' >> .hg/hgrc |
|
181 | $ echo 'deny_push = *' >> .hg/hgrc | |
182 | $ req |
|
182 | $ req | |
183 | pushing to http://localhost:$HGPORT/ |
|
183 | pushing to http://localhost:$HGPORT/ | |
184 | searching for changes |
|
184 | searching for changes | |
185 | abort: authorization failed |
|
185 | abort: authorization failed | |
186 | % serve errors |
|
186 | % serve errors | |
187 | [255] |
|
187 | [255] | |
188 |
|
188 | |||
189 | expect authorization error: some users denied, users must be authenticated |
|
189 | expect authorization error: some users denied, users must be authenticated | |
190 |
|
190 | |||
191 | $ echo 'deny_push = unperson' >> .hg/hgrc |
|
191 | $ echo 'deny_push = unperson' >> .hg/hgrc | |
192 | $ req |
|
192 | $ req | |
193 | pushing to http://localhost:$HGPORT/ |
|
193 | pushing to http://localhost:$HGPORT/ | |
194 | searching for changes |
|
194 | searching for changes | |
195 | abort: authorization failed |
|
195 | abort: authorization failed | |
196 | % serve errors |
|
196 | % serve errors | |
197 | [255] |
|
197 | [255] | |
198 |
|
198 | |||
199 | $ cd .. |
|
199 | $ cd .. |
@@ -1,543 +1,543 b'' | |||||
1 | This test is a duplicate of 'test-http.t' feel free to factor out |
|
1 | This test is a duplicate of 'test-http.t' feel free to factor out | |
2 | parts that are not bundle1/bundle2 specific. |
|
2 | parts that are not bundle1/bundle2 specific. | |
3 |
|
3 | |||
4 | $ cat << EOF >> $HGRCPATH |
|
4 | $ cat << EOF >> $HGRCPATH | |
5 |
> [ |
|
5 | > [devel] | |
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 | > legacy.exchange = bundle1 | |
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' serve -R 'a'repo' --stdio" python "$TESTDIR/../contrib/hg-ssh" |
|
380 | $ SSH_ORIGINAL_COMMAND="'hg' serve -R 'a'repo' --stdio" python "$TESTDIR/../contrib/hg-ssh" | |
381 | Illegal command "'hg' serve -R 'a'repo' --stdio": No closing quotation |
|
381 | Illegal command "'hg' serve -R 'a'repo' --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_NODE_LAST=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_NODE_LAST=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_NODE_LAST=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_NODE_LAST=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_NODE_LAST=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_NODE_LAST=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,45 +1,45 b'' | |||||
1 | #require killdaemons |
|
1 | #require killdaemons | |
2 |
|
2 | |||
3 | Test wire protocol unbundle with hashed heads (capability: unbundlehash) |
|
3 | Test wire protocol unbundle with hashed heads (capability: unbundlehash) | |
4 |
|
4 | |||
5 | $ cat << EOF >> $HGRCPATH |
|
5 | $ cat << EOF >> $HGRCPATH | |
6 |
> [ |
|
6 | > [devel] | |
7 | > # This tests is intended for bundle1 only. |
|
7 | > # This tests is intended for bundle1 only. | |
8 | > # bundle2 carries the head information inside the bundle itself and |
|
8 | > # bundle2 carries the head information inside the bundle itself and | |
9 | > # always uses 'force' as the heads value. |
|
9 | > # always uses 'force' as the heads value. | |
10 | > bundle2-exp = False |
|
10 | > legacy.exchange = bundle1 | |
11 | > EOF |
|
11 | > EOF | |
12 |
|
12 | |||
13 | Create a remote repository. |
|
13 | Create a remote repository. | |
14 |
|
14 | |||
15 | $ hg init remote |
|
15 | $ hg init remote | |
16 | $ hg serve -R remote --config web.push_ssl=False --config web.allow_push=* -p $HGPORT -d --pid-file=hg1.pid -E error.log -A access.log |
|
16 | $ hg serve -R remote --config web.push_ssl=False --config web.allow_push=* -p $HGPORT -d --pid-file=hg1.pid -E error.log -A access.log | |
17 | $ cat hg1.pid >> $DAEMON_PIDS |
|
17 | $ cat hg1.pid >> $DAEMON_PIDS | |
18 |
|
18 | |||
19 | Clone the repository and push a change. |
|
19 | Clone the repository and push a change. | |
20 |
|
20 | |||
21 | $ hg clone http://localhost:$HGPORT/ local |
|
21 | $ hg clone http://localhost:$HGPORT/ local | |
22 | no changes found |
|
22 | no changes found | |
23 | updating to branch default |
|
23 | updating to branch default | |
24 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
24 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
25 | $ touch local/README |
|
25 | $ touch local/README | |
26 | $ hg ci -R local -A -m hoge |
|
26 | $ hg ci -R local -A -m hoge | |
27 | adding README |
|
27 | adding README | |
28 | $ hg push -R local |
|
28 | $ hg push -R local | |
29 | pushing to http://localhost:$HGPORT/ |
|
29 | pushing to http://localhost:$HGPORT/ | |
30 | searching for changes |
|
30 | searching for changes | |
31 | remote: adding changesets |
|
31 | remote: adding changesets | |
32 | remote: adding manifests |
|
32 | remote: adding manifests | |
33 | remote: adding file changes |
|
33 | remote: adding file changes | |
34 | remote: added 1 changesets with 1 changes to 1 files |
|
34 | remote: added 1 changesets with 1 changes to 1 files | |
35 |
|
35 | |||
36 | Ensure hashed heads format is used. |
|
36 | Ensure hashed heads format is used. | |
37 | The hash here is always the same since the remote repository only has the null head. |
|
37 | The hash here is always the same since the remote repository only has the null head. | |
38 |
|
38 | |||
39 | $ cat access.log | grep unbundle |
|
39 | $ cat access.log | grep unbundle | |
40 | * - - [*] "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=686173686564+6768033e216468247bd031a0a2d9876d79818f8f* (glob) |
|
40 | * - - [*] "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=686173686564+6768033e216468247bd031a0a2d9876d79818f8f* (glob) | |
41 |
|
41 | |||
42 | Explicitly kill daemons to let the test exit on Windows |
|
42 | Explicitly kill daemons to let the test exit on Windows | |
43 |
|
43 | |||
44 | $ killdaemons.py |
|
44 | $ killdaemons.py | |
45 |
|
45 |
General Comments 0
You need to be logged in to leave comments.
Login now