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