Show More
@@ -1,396 +1,396 | |||||
1 | #require killdaemons serve |
|
1 | #require killdaemons serve | |
2 |
|
2 | |||
3 | $ hg init test |
|
3 | $ hg init test | |
4 | $ cd test |
|
4 | $ cd test | |
5 | $ echo foo>foo |
|
5 | $ echo foo>foo | |
6 | $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg |
|
6 | $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg | |
7 | $ echo foo>foo.d/foo |
|
7 | $ echo foo>foo.d/foo | |
8 | $ echo bar>foo.d/bAr.hg.d/BaR |
|
8 | $ echo bar>foo.d/bAr.hg.d/BaR | |
9 | $ echo bar>foo.d/baR.d.hg/bAR |
|
9 | $ echo bar>foo.d/baR.d.hg/bAR | |
10 | $ hg commit -A -m 1 |
|
10 | $ hg commit -A -m 1 | |
11 | adding foo |
|
11 | adding foo | |
12 | adding foo.d/bAr.hg.d/BaR |
|
12 | adding foo.d/bAr.hg.d/BaR | |
13 | adding foo.d/baR.d.hg/bAR |
|
13 | adding foo.d/baR.d.hg/bAR | |
14 | adding foo.d/foo |
|
14 | adding foo.d/foo | |
15 | $ hg serve -p $HGPORT -d --pid-file=../hg1.pid -E ../error.log |
|
15 | $ hg serve -p $HGPORT -d --pid-file=../hg1.pid -E ../error.log | |
16 | $ hg serve --config server.uncompressed=False -p $HGPORT1 -d --pid-file=../hg2.pid |
|
16 | $ hg serve --config server.uncompressed=False -p $HGPORT1 -d --pid-file=../hg2.pid | |
17 |
|
17 | |||
18 | Test server address cannot be reused |
|
18 | Test server address cannot be reused | |
19 |
|
19 | |||
20 | #if windows |
|
20 | #if windows | |
21 | $ hg serve -p $HGPORT1 2>&1 |
|
21 | $ hg serve -p $HGPORT1 2>&1 | |
22 | abort: cannot start server at 'localhost:$HGPORT1': * (glob) |
|
22 | abort: cannot start server at 'localhost:$HGPORT1': * (glob) | |
23 | [255] |
|
23 | [255] | |
24 | #else |
|
24 | #else | |
25 | $ hg serve -p $HGPORT1 2>&1 |
|
25 | $ hg serve -p $HGPORT1 2>&1 | |
26 | abort: cannot start server at 'localhost:$HGPORT1': Address already in use |
|
26 | abort: cannot start server at 'localhost:$HGPORT1': Address already in use | |
27 | [255] |
|
27 | [255] | |
28 | #endif |
|
28 | #endif | |
29 | $ cd .. |
|
29 | $ cd .. | |
30 | $ cat hg1.pid hg2.pid >> $DAEMON_PIDS |
|
30 | $ cat hg1.pid hg2.pid >> $DAEMON_PIDS | |
31 |
|
31 | |||
32 | clone via stream |
|
32 | clone via stream | |
33 |
|
33 | |||
34 | $ hg clone --uncompressed http://localhost:$HGPORT/ copy 2>&1 |
|
34 | $ hg clone --uncompressed http://localhost:$HGPORT/ copy 2>&1 | |
35 | streaming all changes |
|
35 | streaming all changes | |
36 | 6 files to transfer, 606 bytes of data |
|
36 | 6 files to transfer, 606 bytes of data | |
37 | transferred * bytes in * seconds (*/sec) (glob) |
|
37 | transferred * bytes in * seconds (*/sec) (glob) | |
38 | searching for changes |
|
38 | searching for changes | |
39 | no changes found |
|
39 | no changes found | |
40 | updating to branch default |
|
40 | updating to branch default | |
41 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
41 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
42 | $ hg verify -R copy |
|
42 | $ hg verify -R copy | |
43 | checking changesets |
|
43 | checking changesets | |
44 | checking manifests |
|
44 | checking manifests | |
45 | crosschecking files in changesets and manifests |
|
45 | crosschecking files in changesets and manifests | |
46 | checking files |
|
46 | checking files | |
47 | 4 files, 1 changesets, 4 total revisions |
|
47 | 4 files, 1 changesets, 4 total revisions | |
48 |
|
48 | |||
49 | try to clone via stream, should use pull instead |
|
49 | try to clone via stream, should use pull instead | |
50 |
|
50 | |||
51 | $ hg clone --uncompressed http://localhost:$HGPORT1/ copy2 |
|
51 | $ hg clone --uncompressed http://localhost:$HGPORT1/ copy2 | |
52 | requesting all changes |
|
52 | requesting all changes | |
53 | adding changesets |
|
53 | adding changesets | |
54 | adding manifests |
|
54 | adding manifests | |
55 | adding file changes |
|
55 | adding file changes | |
56 | added 1 changesets with 4 changes to 4 files |
|
56 | added 1 changesets with 4 changes to 4 files | |
57 | updating to branch default |
|
57 | updating to branch default | |
58 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
58 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
59 |
|
59 | |||
60 | clone via pull |
|
60 | clone via pull | |
61 |
|
61 | |||
62 | $ hg clone http://localhost:$HGPORT1/ copy-pull |
|
62 | $ hg clone http://localhost:$HGPORT1/ copy-pull | |
63 | requesting all changes |
|
63 | requesting all changes | |
64 | adding changesets |
|
64 | adding changesets | |
65 | adding manifests |
|
65 | adding manifests | |
66 | adding file changes |
|
66 | adding file changes | |
67 | added 1 changesets with 4 changes to 4 files |
|
67 | added 1 changesets with 4 changes to 4 files | |
68 | updating to branch default |
|
68 | updating to branch default | |
69 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
69 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
70 | $ hg verify -R copy-pull |
|
70 | $ hg verify -R copy-pull | |
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 | 4 files, 1 changesets, 4 total revisions |
|
75 | 4 files, 1 changesets, 4 total revisions | |
76 | $ cd test |
|
76 | $ cd test | |
77 | $ echo bar > bar |
|
77 | $ echo bar > bar | |
78 | $ hg commit -A -d '1 0' -m 2 |
|
78 | $ hg commit -A -d '1 0' -m 2 | |
79 | adding bar |
|
79 | adding bar | |
80 | $ cd .. |
|
80 | $ cd .. | |
81 |
|
81 | |||
82 | clone over http with --update |
|
82 | clone over http with --update | |
83 |
|
83 | |||
84 | $ hg clone http://localhost:$HGPORT1/ updated --update 0 |
|
84 | $ hg clone http://localhost:$HGPORT1/ updated --update 0 | |
85 | requesting all changes |
|
85 | requesting all changes | |
86 | adding changesets |
|
86 | adding changesets | |
87 | adding manifests |
|
87 | adding manifests | |
88 | adding file changes |
|
88 | adding file changes | |
89 | added 2 changesets with 5 changes to 5 files |
|
89 | added 2 changesets with 5 changes to 5 files | |
90 | updating to branch default |
|
90 | updating to branch default | |
91 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
91 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
92 | $ hg log -r . -R updated |
|
92 | $ hg log -r . -R updated | |
93 | changeset: 0:8b6053c928fe |
|
93 | changeset: 0:8b6053c928fe | |
94 | user: test |
|
94 | user: test | |
95 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
95 | date: Thu Jan 01 00:00:00 1970 +0000 | |
96 | summary: 1 |
|
96 | summary: 1 | |
97 |
|
97 | |||
98 | $ rm -rf updated |
|
98 | $ rm -rf updated | |
99 |
|
99 | |||
100 | incoming via HTTP |
|
100 | incoming via HTTP | |
101 |
|
101 | |||
102 | $ hg clone http://localhost:$HGPORT1/ --rev 0 partial |
|
102 | $ hg clone http://localhost:$HGPORT1/ --rev 0 partial | |
103 | adding changesets |
|
103 | adding changesets | |
104 | adding manifests |
|
104 | adding manifests | |
105 | adding file changes |
|
105 | adding file changes | |
106 | added 1 changesets with 4 changes to 4 files |
|
106 | added 1 changesets with 4 changes to 4 files | |
107 | updating to branch default |
|
107 | updating to branch default | |
108 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
108 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
109 | $ cd partial |
|
109 | $ cd partial | |
110 | $ touch LOCAL |
|
110 | $ touch LOCAL | |
111 | $ hg ci -qAm LOCAL |
|
111 | $ hg ci -qAm LOCAL | |
112 | $ hg incoming http://localhost:$HGPORT1/ --template '{desc}\n' |
|
112 | $ hg incoming http://localhost:$HGPORT1/ --template '{desc}\n' | |
113 | comparing with http://localhost:$HGPORT1/ |
|
113 | comparing with http://localhost:$HGPORT1/ | |
114 | searching for changes |
|
114 | searching for changes | |
115 | 2 |
|
115 | 2 | |
116 | $ cd .. |
|
116 | $ cd .. | |
117 |
|
117 | |||
118 | pull |
|
118 | pull | |
119 |
|
119 | |||
120 | $ cd copy-pull |
|
120 | $ cd copy-pull | |
121 | $ cat >> .hg/hgrc <<EOF |
|
121 | $ cat >> .hg/hgrc <<EOF | |
122 | > [hooks] |
|
122 | > [hooks] | |
123 | > changegroup = sh -c "printenv.py changegroup" |
|
123 | > changegroup = sh -c "printenv.py changegroup" | |
124 | > EOF |
|
124 | > EOF | |
125 | $ hg pull |
|
125 | $ hg pull | |
126 | pulling from http://localhost:$HGPORT1/ |
|
126 | pulling from http://localhost:$HGPORT1/ | |
127 | searching for changes |
|
127 | searching for changes | |
128 | adding changesets |
|
128 | adding changesets | |
129 | adding manifests |
|
129 | adding manifests | |
130 | adding file changes |
|
130 | adding file changes | |
131 | added 1 changesets with 1 changes to 1 files |
|
131 | added 1 changesets with 1 changes to 1 files | |
132 | changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=http://localhost:$HGPORT1/ |
|
132 | changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=http://localhost:$HGPORT1/ | |
133 | (run 'hg update' to get a working copy) |
|
133 | (run 'hg update' to get a working copy) | |
134 | $ cd .. |
|
134 | $ cd .. | |
135 |
|
135 | |||
136 | clone from invalid URL |
|
136 | clone from invalid URL | |
137 |
|
137 | |||
138 | $ hg clone http://localhost:$HGPORT/bad |
|
138 | $ hg clone http://localhost:$HGPORT/bad | |
139 | abort: HTTP Error 404: Not Found |
|
139 | abort: HTTP Error 404: Not Found | |
140 | [255] |
|
140 | [255] | |
141 |
|
141 | |||
142 | test http authentication |
|
142 | test http authentication | |
143 | + use the same server to test server side streaming preference |
|
143 | + use the same server to test server side streaming preference | |
144 |
|
144 | |||
145 | $ cd test |
|
145 | $ cd test | |
146 | $ cat << EOT > userpass.py |
|
146 | $ cat << EOT > userpass.py | |
147 | > import base64 |
|
147 | > import base64 | |
148 | > from mercurial.hgweb import common |
|
148 | > from mercurial.hgweb import common | |
149 | > def perform_authentication(hgweb, req, op): |
|
149 | > def perform_authentication(hgweb, req, op): | |
150 | > auth = req.env.get('HTTP_AUTHORIZATION') |
|
150 | > auth = req.env.get('HTTP_AUTHORIZATION') | |
151 | > if not auth: |
|
151 | > if not auth: | |
152 | > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, 'who', |
|
152 | > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, 'who', | |
153 | > [('WWW-Authenticate', 'Basic Realm="mercurial"')]) |
|
153 | > [('WWW-Authenticate', 'Basic Realm="mercurial"')]) | |
154 | > if base64.b64decode(auth.split()[1]).split(':', 1) != ['user', 'pass']: |
|
154 | > if base64.b64decode(auth.split()[1]).split(':', 1) != ['user', 'pass']: | |
155 | > raise common.ErrorResponse(common.HTTP_FORBIDDEN, 'no') |
|
155 | > raise common.ErrorResponse(common.HTTP_FORBIDDEN, 'no') | |
156 | > def extsetup(): |
|
156 | > def extsetup(): | |
157 | > common.permhooks.insert(0, perform_authentication) |
|
157 | > common.permhooks.insert(0, perform_authentication) | |
158 | > EOT |
|
158 | > EOT | |
159 | $ hg serve --config extensions.x=userpass.py -p $HGPORT2 -d --pid-file=pid \ |
|
159 | $ hg serve --config extensions.x=userpass.py -p $HGPORT2 -d --pid-file=pid \ | |
160 | > --config server.preferuncompressed=True \ |
|
160 | > --config server.preferuncompressed=True \ | |
161 | > --config web.push_ssl=False --config web.allow_push=* -A ../access.log |
|
161 | > --config web.push_ssl=False --config web.allow_push=* -A ../access.log | |
162 | $ cat pid >> $DAEMON_PIDS |
|
162 | $ cat pid >> $DAEMON_PIDS | |
163 |
|
163 | |||
164 | $ cat << EOF > get_pass.py |
|
164 | $ cat << EOF > get_pass.py | |
165 | > import getpass |
|
165 | > import getpass | |
166 | > def newgetpass(arg): |
|
166 | > def newgetpass(arg): | |
167 | > return "pass" |
|
167 | > return "pass" | |
168 | > getpass.getpass = newgetpass |
|
168 | > getpass.getpass = newgetpass | |
169 | > EOF |
|
169 | > EOF | |
170 |
|
170 | |||
171 | $ hg id http://localhost:$HGPORT2/ |
|
171 | $ hg id http://localhost:$HGPORT2/ | |
172 | abort: http authorization required for http://localhost:$HGPORT2/ |
|
172 | abort: http authorization required for http://localhost:$HGPORT2/ | |
173 | [255] |
|
173 | [255] | |
174 | $ hg id http://localhost:$HGPORT2/ |
|
174 | $ hg id http://localhost:$HGPORT2/ | |
175 | abort: http authorization required for http://localhost:$HGPORT2/ |
|
175 | abort: http authorization required for http://localhost:$HGPORT2/ | |
176 | [255] |
|
176 | [255] | |
177 | $ hg id --config ui.interactive=true --config extensions.getpass=get_pass.py http://user@localhost:$HGPORT2/ |
|
177 | $ hg id --config ui.interactive=true --config extensions.getpass=get_pass.py http://user@localhost:$HGPORT2/ | |
178 | http authorization required for http://localhost:$HGPORT2/ |
|
178 | http authorization required for http://localhost:$HGPORT2/ | |
179 | realm: mercurial |
|
179 | realm: mercurial | |
180 | user: user |
|
180 | user: user | |
181 | password: 5fed3813f7f5 |
|
181 | password: 5fed3813f7f5 | |
182 | $ hg id http://user:pass@localhost:$HGPORT2/ |
|
182 | $ hg id http://user:pass@localhost:$HGPORT2/ | |
183 | 5fed3813f7f5 |
|
183 | 5fed3813f7f5 | |
184 | $ echo '[auth]' >> .hg/hgrc |
|
184 | $ echo '[auth]' >> .hg/hgrc | |
185 | $ echo 'l.schemes=http' >> .hg/hgrc |
|
185 | $ echo 'l.schemes=http' >> .hg/hgrc | |
186 | $ echo 'l.prefix=lo' >> .hg/hgrc |
|
186 | $ echo 'l.prefix=lo' >> .hg/hgrc | |
187 | $ echo 'l.username=user' >> .hg/hgrc |
|
187 | $ echo 'l.username=user' >> .hg/hgrc | |
188 | $ echo 'l.password=pass' >> .hg/hgrc |
|
188 | $ echo 'l.password=pass' >> .hg/hgrc | |
189 | $ hg id http://localhost:$HGPORT2/ |
|
189 | $ hg id http://localhost:$HGPORT2/ | |
190 | 5fed3813f7f5 |
|
190 | 5fed3813f7f5 | |
191 | $ hg id http://localhost:$HGPORT2/ |
|
191 | $ hg id http://localhost:$HGPORT2/ | |
192 | 5fed3813f7f5 |
|
192 | 5fed3813f7f5 | |
193 | $ hg id http://user@localhost:$HGPORT2/ |
|
193 | $ hg id http://user@localhost:$HGPORT2/ | |
194 | 5fed3813f7f5 |
|
194 | 5fed3813f7f5 | |
195 | $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1 |
|
195 | $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1 | |
196 | streaming all changes |
|
196 | streaming all changes | |
197 | 7 files to transfer, 916 bytes of data |
|
197 | 7 files to transfer, 916 bytes of data | |
198 | transferred * bytes in * seconds (*/sec) (glob) |
|
198 | transferred * bytes in * seconds (*/sec) (glob) | |
199 | searching for changes |
|
199 | searching for changes | |
200 | no changes found |
|
200 | no changes found | |
201 | updating to branch default |
|
201 | updating to branch default | |
202 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
202 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
203 | --pull should override server's preferuncompressed |
|
203 | --pull should override server's preferuncompressed | |
204 | $ hg clone --pull http://user:pass@localhost:$HGPORT2/ dest-pull 2>&1 |
|
204 | $ hg clone --pull http://user:pass@localhost:$HGPORT2/ dest-pull 2>&1 | |
205 | requesting all changes |
|
205 | requesting all changes | |
206 | adding changesets |
|
206 | adding changesets | |
207 | adding manifests |
|
207 | adding manifests | |
208 | adding file changes |
|
208 | adding file changes | |
209 | added 2 changesets with 5 changes to 5 files |
|
209 | added 2 changesets with 5 changes to 5 files | |
210 | updating to branch default |
|
210 | updating to branch default | |
211 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
211 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
212 |
|
212 | |||
213 | $ hg id http://user2@localhost:$HGPORT2/ |
|
213 | $ hg id http://user2@localhost:$HGPORT2/ | |
214 | abort: http authorization required for http://localhost:$HGPORT2/ |
|
214 | abort: http authorization required for http://localhost:$HGPORT2/ | |
215 | [255] |
|
215 | [255] | |
216 | $ hg id http://user:pass2@localhost:$HGPORT2/ |
|
216 | $ hg id http://user:pass2@localhost:$HGPORT2/ | |
217 | abort: HTTP Error 403: no |
|
217 | abort: HTTP Error 403: no | |
218 | [255] |
|
218 | [255] | |
219 |
|
219 | |||
220 | $ hg -R dest tag -r tip top |
|
220 | $ hg -R dest tag -r tip top | |
221 | $ hg -R dest push http://user:pass@localhost:$HGPORT2/ |
|
221 | $ hg -R dest push http://user:pass@localhost:$HGPORT2/ | |
222 | pushing to http://user:***@localhost:$HGPORT2/ |
|
222 | pushing to http://user:***@localhost:$HGPORT2/ | |
223 | searching for changes |
|
223 | searching for changes | |
224 | remote: adding changesets |
|
224 | remote: adding changesets | |
225 | remote: adding manifests |
|
225 | remote: adding manifests | |
226 | remote: adding file changes |
|
226 | remote: adding file changes | |
227 | remote: added 1 changesets with 1 changes to 1 files |
|
227 | remote: added 1 changesets with 1 changes to 1 files | |
228 | $ hg rollback -q |
|
228 | $ hg rollback -q | |
229 |
|
229 | |||
230 | $ sed 's/.*] "/"/' < ../access.log |
|
230 | $ sed 's/.*] "/"/' < ../access.log | |
231 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
231 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
232 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
232 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
233 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
233 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
234 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
234 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
235 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
235 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
236 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
236 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
237 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
237 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
238 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
238 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
239 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
239 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
240 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
240 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
241 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
241 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
242 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
242 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
243 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
243 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
244 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
244 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
245 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
245 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
246 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
246 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
247 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
247 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
248 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
248 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
249 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
249 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
250 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
250 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
251 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
251 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
252 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
252 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
253 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
253 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
254 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
254 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
255 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
255 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
256 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
256 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
257 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
257 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
258 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
258 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
259 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
259 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
260 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
260 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
261 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
261 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
262 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
262 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
263 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
263 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
264 | "GET /?cmd=stream_out HTTP/1.1" 401 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
264 | "GET /?cmd=stream_out HTTP/1.1" 401 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
265 | "GET /?cmd=stream_out HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
265 | "GET /?cmd=stream_out HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
266 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
266 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
267 | "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=0&common=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=phases%2Cbookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
267 | "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=0&common=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=phases%2Cbookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
268 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
268 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
269 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
269 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
270 | "GET /?cmd=getbundle HTTP/1.1" 401 - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=phases%2Cbookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
270 | "GET /?cmd=getbundle HTTP/1.1" 401 - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=phases%2Cbookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
271 | "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=phases%2Cbookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
271 | "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=phases%2Cbookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
272 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
272 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
273 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
273 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
274 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
274 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
275 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
275 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
276 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
276 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
277 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
277 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
278 | "GET /?cmd=listkeys HTTP/1.1" 403 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
278 | "GET /?cmd=listkeys HTTP/1.1" 403 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
279 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
279 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
280 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
280 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
281 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
281 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
282 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
282 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
283 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
283 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
284 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
284 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
285 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
285 | "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
286 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
286 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
287 | "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=666f726365* (glob) |
|
287 | "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=666f726365* (glob) | |
288 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) |
|
288 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob) | |
289 |
|
289 | |||
290 | $ cd .. |
|
290 | $ cd .. | |
291 |
|
291 | |||
292 | clone of serve with repo in root and unserved subrepo (issue2970) |
|
292 | clone of serve with repo in root and unserved subrepo (issue2970) | |
293 |
|
293 | |||
294 | $ hg --cwd test init sub |
|
294 | $ hg --cwd test init sub | |
295 | $ echo empty > test/sub/empty |
|
295 | $ echo empty > test/sub/empty | |
296 | $ hg --cwd test/sub add empty |
|
296 | $ hg --cwd test/sub add empty | |
297 | $ hg --cwd test/sub commit -qm 'add empty' |
|
297 | $ hg --cwd test/sub commit -qm 'add empty' | |
298 | $ hg --cwd test/sub tag -r 0 something |
|
298 | $ hg --cwd test/sub tag -r 0 something | |
299 | $ echo sub = sub > test/.hgsub |
|
299 | $ echo sub = sub > test/.hgsub | |
300 | $ hg --cwd test add .hgsub |
|
300 | $ hg --cwd test add .hgsub | |
301 | $ hg --cwd test commit -qm 'add subrepo' |
|
301 | $ hg --cwd test commit -qm 'add subrepo' | |
302 | $ hg clone http://localhost:$HGPORT noslash-clone |
|
302 | $ hg clone http://localhost:$HGPORT noslash-clone | |
303 | requesting all changes |
|
303 | requesting all changes | |
304 | adding changesets |
|
304 | adding changesets | |
305 | adding manifests |
|
305 | adding manifests | |
306 | adding file changes |
|
306 | adding file changes | |
307 | added 3 changesets with 7 changes to 7 files |
|
307 | added 3 changesets with 7 changes to 7 files | |
308 | updating to branch default |
|
308 | updating to branch default | |
309 | abort: HTTP Error 404: Not Found |
|
309 | abort: HTTP Error 404: Not Found | |
310 | [255] |
|
310 | [255] | |
311 | $ hg clone http://localhost:$HGPORT/ slash-clone |
|
311 | $ hg clone http://localhost:$HGPORT/ slash-clone | |
312 | requesting all changes |
|
312 | requesting all changes | |
313 | adding changesets |
|
313 | adding changesets | |
314 | adding manifests |
|
314 | adding manifests | |
315 | adding file changes |
|
315 | adding file changes | |
316 | added 3 changesets with 7 changes to 7 files |
|
316 | added 3 changesets with 7 changes to 7 files | |
317 | updating to branch default |
|
317 | updating to branch default | |
318 | abort: HTTP Error 404: Not Found |
|
318 | abort: HTTP Error 404: Not Found | |
319 | [255] |
|
319 | [255] | |
320 |
|
320 | |||
321 | check error log |
|
321 | check error log | |
322 |
|
322 | |||
323 | $ cat error.log |
|
323 | $ cat error.log | |
324 |
|
324 | |||
325 | check abort error reporting while pulling/cloning |
|
325 | check abort error reporting while pulling/cloning | |
326 |
|
326 | |||
327 | $ $RUNTESTDIR/killdaemons.py |
|
327 | $ $RUNTESTDIR/killdaemons.py | |
328 | $ hg -R test serve -p $HGPORT -d --pid-file=hg3.pid -E error.log --config extensions.crash=${TESTDIR}/crashgetbundler.py |
|
328 | $ hg -R test serve -p $HGPORT -d --pid-file=hg3.pid -E error.log --config extensions.crash=${TESTDIR}/crashgetbundler.py | |
329 | $ cat hg3.pid >> $DAEMON_PIDS |
|
329 | $ cat hg3.pid >> $DAEMON_PIDS | |
330 | $ hg clone http://localhost:$HGPORT/ abort-clone |
|
330 | $ hg clone http://localhost:$HGPORT/ abort-clone | |
331 | requesting all changes |
|
331 | requesting all changes | |
332 | remote: abort: this is an exercise |
|
332 | remote: abort: this is an exercise | |
333 | abort: pull failed on remote |
|
333 | abort: pull failed on remote | |
334 | [255] |
|
334 | [255] | |
335 | $ cat error.log |
|
335 | $ cat error.log | |
336 |
|
336 | |||
337 | corrupt cookies file should yield a warning |
|
337 | corrupt cookies file should yield a warning | |
338 |
|
338 | |||
339 | $ cat > $TESTTMP/cookies.txt << EOF |
|
339 | $ cat > $TESTTMP/cookies.txt << EOF | |
340 | > bad format |
|
340 | > bad format | |
341 | > EOF |
|
341 | > EOF | |
342 |
|
342 | |||
343 | $ hg --config auth.cookiefile=$TESTTMP/cookies.txt id http://localhost:$HGPORT/ |
|
343 | $ hg --config auth.cookiefile=$TESTTMP/cookies.txt id http://localhost:$HGPORT/ | |
344 |
(error loading cookie file $TESTTMP/cookies.txt: ' |
|
344 | (error loading cookie file $TESTTMP/cookies.txt: '*/cookies.txt' does not look like a Netscape format cookies file; continuing without cookies) (glob) | |
345 | 56f9bc90cce6 |
|
345 | 56f9bc90cce6 | |
346 |
|
346 | |||
347 | $ killdaemons.py |
|
347 | $ killdaemons.py | |
348 |
|
348 | |||
349 | Create dummy authentication handler that looks for cookies. It doesn't do anything |
|
349 | Create dummy authentication handler that looks for cookies. It doesn't do anything | |
350 | useful. It just raises an HTTP 500 with details about the Cookie request header. |
|
350 | useful. It just raises an HTTP 500 with details about the Cookie request header. | |
351 | We raise HTTP 500 because its message is printed in the abort message. |
|
351 | We raise HTTP 500 because its message is printed in the abort message. | |
352 |
|
352 | |||
353 | $ cat > cookieauth.py << EOF |
|
353 | $ cat > cookieauth.py << EOF | |
354 | > from mercurial import util |
|
354 | > from mercurial import util | |
355 | > from mercurial.hgweb import common |
|
355 | > from mercurial.hgweb import common | |
356 | > def perform_authentication(hgweb, req, op): |
|
356 | > def perform_authentication(hgweb, req, op): | |
357 | > cookie = req.env.get('HTTP_COOKIE') |
|
357 | > cookie = req.env.get('HTTP_COOKIE') | |
358 | > if not cookie: |
|
358 | > if not cookie: | |
359 | > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, 'no-cookie') |
|
359 | > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, 'no-cookie') | |
360 | > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, 'Cookie: %s' % cookie) |
|
360 | > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, 'Cookie: %s' % cookie) | |
361 | > def extsetup(): |
|
361 | > def extsetup(): | |
362 | > common.permhooks.insert(0, perform_authentication) |
|
362 | > common.permhooks.insert(0, perform_authentication) | |
363 | > EOF |
|
363 | > EOF | |
364 |
|
364 | |||
365 | $ hg serve --config extensions.cookieauth=cookieauth.py -R test -p $HGPORT -d --pid-file=pid |
|
365 | $ hg serve --config extensions.cookieauth=cookieauth.py -R test -p $HGPORT -d --pid-file=pid | |
366 | $ cat pid > $DAEMON_PIDS |
|
366 | $ cat pid > $DAEMON_PIDS | |
367 |
|
367 | |||
368 | Request without cookie sent should fail due to lack of cookie |
|
368 | Request without cookie sent should fail due to lack of cookie | |
369 |
|
369 | |||
370 | $ hg id http://localhost:$HGPORT |
|
370 | $ hg id http://localhost:$HGPORT | |
371 | abort: HTTP Error 500: no-cookie |
|
371 | abort: HTTP Error 500: no-cookie | |
372 | [255] |
|
372 | [255] | |
373 |
|
373 | |||
374 | Populate a cookies file |
|
374 | Populate a cookies file | |
375 |
|
375 | |||
376 | $ cat > cookies.txt << EOF |
|
376 | $ cat > cookies.txt << EOF | |
377 | > # HTTP Cookie File |
|
377 | > # HTTP Cookie File | |
378 | > # Expiration is 2030-01-01 at midnight |
|
378 | > # Expiration is 2030-01-01 at midnight | |
379 | > .example.com TRUE / FALSE 1893456000 hgkey examplevalue |
|
379 | > .example.com TRUE / FALSE 1893456000 hgkey examplevalue | |
380 | > EOF |
|
380 | > EOF | |
381 |
|
381 | |||
382 | Should not send a cookie for another domain |
|
382 | Should not send a cookie for another domain | |
383 |
|
383 | |||
384 | $ hg --config auth.cookiefile=cookies.txt id http://localhost:$HGPORT/ |
|
384 | $ hg --config auth.cookiefile=cookies.txt id http://localhost:$HGPORT/ | |
385 | abort: HTTP Error 500: no-cookie |
|
385 | abort: HTTP Error 500: no-cookie | |
386 | [255] |
|
386 | [255] | |
387 |
|
387 | |||
388 | Add a cookie entry for our test server and verify it is sent |
|
388 | Add a cookie entry for our test server and verify it is sent | |
389 |
|
389 | |||
390 | $ cat >> cookies.txt << EOF |
|
390 | $ cat >> cookies.txt << EOF | |
391 | > localhost.local FALSE / FALSE 1893456000 hgkey localhostvalue |
|
391 | > localhost.local FALSE / FALSE 1893456000 hgkey localhostvalue | |
392 | > EOF |
|
392 | > EOF | |
393 |
|
393 | |||
394 | $ hg --config auth.cookiefile=cookies.txt id http://localhost:$HGPORT/ |
|
394 | $ hg --config auth.cookiefile=cookies.txt id http://localhost:$HGPORT/ | |
395 | abort: HTTP Error 500: Cookie: hgkey=localhostvalue |
|
395 | abort: HTTP Error 500: Cookie: hgkey=localhostvalue | |
396 | [255] |
|
396 | [255] |
General Comments 0
You need to be logged in to leave comments.
Login now