##// END OF EJS Templates
tests: update test-largefiles-wireproto to pass our import checker
Augie Fackler -
r33965:9a0f33f4 default
parent child Browse files
Show More
@@ -1,447 +1,448
1 This file contains testcases that tend to be related to the wire protocol part
1 This file contains testcases that tend to be related to the wire protocol part
2 of largefiles.
2 of largefiles.
3
3
4 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
4 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
5 $ mkdir "${USERCACHE}"
5 $ mkdir "${USERCACHE}"
6 $ cat >> $HGRCPATH <<EOF
6 $ cat >> $HGRCPATH <<EOF
7 > [extensions]
7 > [extensions]
8 > largefiles=
8 > largefiles=
9 > purge=
9 > purge=
10 > rebase=
10 > rebase=
11 > transplant=
11 > transplant=
12 > [phases]
12 > [phases]
13 > publish=False
13 > publish=False
14 > [largefiles]
14 > [largefiles]
15 > minsize=2
15 > minsize=2
16 > patterns=glob:**.dat
16 > patterns=glob:**.dat
17 > usercache=${USERCACHE}
17 > usercache=${USERCACHE}
18 > [web]
18 > [web]
19 > allow_archive = zip
19 > allow_archive = zip
20 > [hooks]
20 > [hooks]
21 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
21 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
22 > EOF
22 > EOF
23
23
24
24
25 #if serve
25 #if serve
26 vanilla clients not locked out from largefiles servers on vanilla repos
26 vanilla clients not locked out from largefiles servers on vanilla repos
27 $ mkdir r1
27 $ mkdir r1
28 $ cd r1
28 $ cd r1
29 $ hg init
29 $ hg init
30 $ echo c1 > f1
30 $ echo c1 > f1
31 $ hg add f1
31 $ hg add f1
32 $ hg commit -m "m1"
32 $ hg commit -m "m1"
33 Invoking status precommit hook
33 Invoking status precommit hook
34 A f1
34 A f1
35 $ cd ..
35 $ cd ..
36 $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid
36 $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid
37 $ cat hg.pid >> $DAEMON_PIDS
37 $ cat hg.pid >> $DAEMON_PIDS
38 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2
38 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2
39 requesting all changes
39 requesting all changes
40 adding changesets
40 adding changesets
41 adding manifests
41 adding manifests
42 adding file changes
42 adding file changes
43 added 1 changesets with 1 changes to 1 files
43 added 1 changesets with 1 changes to 1 files
44 updating to branch default
44 updating to branch default
45 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
45 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
46
46
47 largefiles clients still work with vanilla servers
47 largefiles clients still work with vanilla servers
48 $ hg serve --config extensions.largefiles=! -R r1 -d -p $HGPORT1 --pid-file hg.pid
48 $ hg serve --config extensions.largefiles=! -R r1 -d -p $HGPORT1 --pid-file hg.pid
49 $ cat hg.pid >> $DAEMON_PIDS
49 $ cat hg.pid >> $DAEMON_PIDS
50 $ hg clone http://localhost:$HGPORT1 r3
50 $ hg clone http://localhost:$HGPORT1 r3
51 requesting all changes
51 requesting all changes
52 adding changesets
52 adding changesets
53 adding manifests
53 adding manifests
54 adding file changes
54 adding file changes
55 added 1 changesets with 1 changes to 1 files
55 added 1 changesets with 1 changes to 1 files
56 updating to branch default
56 updating to branch default
57 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
57 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
58 #endif
58 #endif
59
59
60 vanilla clients locked out from largefiles http repos
60 vanilla clients locked out from largefiles http repos
61 $ mkdir r4
61 $ mkdir r4
62 $ cd r4
62 $ cd r4
63 $ hg init
63 $ hg init
64 $ echo c1 > f1
64 $ echo c1 > f1
65 $ hg add --large f1
65 $ hg add --large f1
66 $ hg commit -m "m1"
66 $ hg commit -m "m1"
67 Invoking status precommit hook
67 Invoking status precommit hook
68 A f1
68 A f1
69 $ cd ..
69 $ cd ..
70
70
71 largefiles can be pushed locally (issue3583)
71 largefiles can be pushed locally (issue3583)
72 $ hg init dest
72 $ hg init dest
73 $ cd r4
73 $ cd r4
74 $ hg outgoing ../dest
74 $ hg outgoing ../dest
75 comparing with ../dest
75 comparing with ../dest
76 searching for changes
76 searching for changes
77 changeset: 0:639881c12b4c
77 changeset: 0:639881c12b4c
78 tag: tip
78 tag: tip
79 user: test
79 user: test
80 date: Thu Jan 01 00:00:00 1970 +0000
80 date: Thu Jan 01 00:00:00 1970 +0000
81 summary: m1
81 summary: m1
82
82
83 $ hg push ../dest
83 $ hg push ../dest
84 pushing to ../dest
84 pushing to ../dest
85 searching for changes
85 searching for changes
86 adding changesets
86 adding changesets
87 adding manifests
87 adding manifests
88 adding file changes
88 adding file changes
89 added 1 changesets with 1 changes to 1 files
89 added 1 changesets with 1 changes to 1 files
90
90
91 exit code with nothing outgoing (issue3611)
91 exit code with nothing outgoing (issue3611)
92 $ hg outgoing ../dest
92 $ hg outgoing ../dest
93 comparing with ../dest
93 comparing with ../dest
94 searching for changes
94 searching for changes
95 no changes found
95 no changes found
96 [1]
96 [1]
97 $ cd ..
97 $ cd ..
98
98
99 #if serve
99 #if serve
100 $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid
100 $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid
101 $ cat hg.pid >> $DAEMON_PIDS
101 $ cat hg.pid >> $DAEMON_PIDS
102 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5
102 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5
103 abort: remote error:
103 abort: remote error:
104
104
105 This repository uses the largefiles extension.
105 This repository uses the largefiles extension.
106
106
107 Please enable it in your Mercurial config file.
107 Please enable it in your Mercurial config file.
108 [255]
108 [255]
109
109
110 used all HGPORTs, kill all daemons
110 used all HGPORTs, kill all daemons
111 $ killdaemons.py
111 $ killdaemons.py
112 #endif
112 #endif
113
113
114 vanilla clients locked out from largefiles ssh repos
114 vanilla clients locked out from largefiles ssh repos
115 $ hg --config extensions.largefiles=! clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5
115 $ hg --config extensions.largefiles=! clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5
116 remote:
116 remote:
117 remote: This repository uses the largefiles extension.
117 remote: This repository uses the largefiles extension.
118 remote:
118 remote:
119 remote: Please enable it in your Mercurial config file.
119 remote: Please enable it in your Mercurial config file.
120 remote:
120 remote:
121 remote: -
121 remote: -
122 abort: remote error
122 abort: remote error
123 (check previous remote output)
123 (check previous remote output)
124 [255]
124 [255]
125
125
126 #if serve
126 #if serve
127
127
128 largefiles clients refuse to push largefiles repos to vanilla servers
128 largefiles clients refuse to push largefiles repos to vanilla servers
129 $ mkdir r6
129 $ mkdir r6
130 $ cd r6
130 $ cd r6
131 $ hg init
131 $ hg init
132 $ echo c1 > f1
132 $ echo c1 > f1
133 $ hg add f1
133 $ hg add f1
134 $ hg commit -m "m1"
134 $ hg commit -m "m1"
135 Invoking status precommit hook
135 Invoking status precommit hook
136 A f1
136 A f1
137 $ cat >> .hg/hgrc <<!
137 $ cat >> .hg/hgrc <<!
138 > [web]
138 > [web]
139 > push_ssl = false
139 > push_ssl = false
140 > allow_push = *
140 > allow_push = *
141 > !
141 > !
142 $ cd ..
142 $ cd ..
143 $ hg clone r6 r7
143 $ hg clone r6 r7
144 updating to branch default
144 updating to branch default
145 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
145 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
146 $ cd r7
146 $ cd r7
147 $ echo c2 > f2
147 $ echo c2 > f2
148 $ hg add --large f2
148 $ hg add --large f2
149 $ hg commit -m "m2"
149 $ hg commit -m "m2"
150 Invoking status precommit hook
150 Invoking status precommit hook
151 A f2
151 A f2
152 $ hg verify --large
152 $ hg verify --large
153 checking changesets
153 checking changesets
154 checking manifests
154 checking manifests
155 crosschecking files in changesets and manifests
155 crosschecking files in changesets and manifests
156 checking files
156 checking files
157 2 files, 2 changesets, 2 total revisions
157 2 files, 2 changesets, 2 total revisions
158 searching 1 changesets for largefiles
158 searching 1 changesets for largefiles
159 verified existence of 1 revisions of 1 largefiles
159 verified existence of 1 revisions of 1 largefiles
160 $ hg serve --config extensions.largefiles=! -R ../r6 -d -p $HGPORT --pid-file ../hg.pid
160 $ hg serve --config extensions.largefiles=! -R ../r6 -d -p $HGPORT --pid-file ../hg.pid
161 $ cat ../hg.pid >> $DAEMON_PIDS
161 $ cat ../hg.pid >> $DAEMON_PIDS
162 $ hg push http://localhost:$HGPORT
162 $ hg push http://localhost:$HGPORT
163 pushing to http://localhost:$HGPORT/
163 pushing to http://localhost:$HGPORT/
164 searching for changes
164 searching for changes
165 abort: http://localhost:$HGPORT/ does not appear to be a largefile store
165 abort: http://localhost:$HGPORT/ does not appear to be a largefile store
166 [255]
166 [255]
167 $ cd ..
167 $ cd ..
168
168
169 putlfile errors are shown (issue3123)
169 putlfile errors are shown (issue3123)
170 Corrupt the cached largefile in r7 and move it out of the servers usercache
170 Corrupt the cached largefile in r7 and move it out of the servers usercache
171 $ mv r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 .
171 $ mv r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 .
172 $ echo 'client side corruption' > r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
172 $ echo 'client side corruption' > r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
173 $ rm "$USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8"
173 $ rm "$USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8"
174 $ hg init empty
174 $ hg init empty
175 $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \
175 $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \
176 > --config 'web.allow_push=*' --config web.push_ssl=False
176 > --config 'web.allow_push=*' --config web.push_ssl=False
177 $ cat hg.pid >> $DAEMON_PIDS
177 $ cat hg.pid >> $DAEMON_PIDS
178 $ hg push -R r7 http://localhost:$HGPORT1
178 $ hg push -R r7 http://localhost:$HGPORT1
179 pushing to http://localhost:$HGPORT1/
179 pushing to http://localhost:$HGPORT1/
180 searching for changes
180 searching for changes
181 remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash
181 remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash
182 abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/ (glob)
182 abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/ (glob)
183 [255]
183 [255]
184 $ mv 4cdac4d8b084d0b599525cf732437fb337d422a8 r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
184 $ mv 4cdac4d8b084d0b599525cf732437fb337d422a8 r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
185 Push of file that exists on server but is corrupted - magic healing would be nice ... but too magic
185 Push of file that exists on server but is corrupted - magic healing would be nice ... but too magic
186 $ echo "server side corruption" > empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
186 $ echo "server side corruption" > empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
187 $ hg push -R r7 http://localhost:$HGPORT1
187 $ hg push -R r7 http://localhost:$HGPORT1
188 pushing to http://localhost:$HGPORT1/
188 pushing to http://localhost:$HGPORT1/
189 searching for changes
189 searching for changes
190 remote: adding changesets
190 remote: adding changesets
191 remote: adding manifests
191 remote: adding manifests
192 remote: adding file changes
192 remote: adding file changes
193 remote: added 2 changesets with 2 changes to 2 files
193 remote: added 2 changesets with 2 changes to 2 files
194 $ cat empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
194 $ cat empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
195 server side corruption
195 server side corruption
196 $ rm -rf empty
196 $ rm -rf empty
197
197
198 Push a largefiles repository to a served empty repository
198 Push a largefiles repository to a served empty repository
199 $ hg init r8
199 $ hg init r8
200 $ echo c3 > r8/f1
200 $ echo c3 > r8/f1
201 $ hg add --large r8/f1 -R r8
201 $ hg add --large r8/f1 -R r8
202 $ hg commit -m "m1" -R r8
202 $ hg commit -m "m1" -R r8
203 Invoking status precommit hook
203 Invoking status precommit hook
204 A f1
204 A f1
205 $ hg init empty
205 $ hg init empty
206 $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \
206 $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \
207 > --config 'web.allow_push=*' --config web.push_ssl=False
207 > --config 'web.allow_push=*' --config web.push_ssl=False
208 $ cat hg.pid >> $DAEMON_PIDS
208 $ cat hg.pid >> $DAEMON_PIDS
209 $ rm "${USERCACHE}"/*
209 $ rm "${USERCACHE}"/*
210 $ hg push -R r8 http://localhost:$HGPORT2/#default
210 $ hg push -R r8 http://localhost:$HGPORT2/#default
211 pushing to http://localhost:$HGPORT2/
211 pushing to http://localhost:$HGPORT2/
212 searching for changes
212 searching for changes
213 remote: adding changesets
213 remote: adding changesets
214 remote: adding manifests
214 remote: adding manifests
215 remote: adding file changes
215 remote: adding file changes
216 remote: added 1 changesets with 1 changes to 1 files
216 remote: added 1 changesets with 1 changes to 1 files
217 $ [ -f "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
217 $ [ -f "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
218 $ [ -f empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
218 $ [ -f empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
219
219
220 Clone over http, no largefiles pulled on clone.
220 Clone over http, no largefiles pulled on clone.
221
221
222 $ hg clone http://localhost:$HGPORT2/#default http-clone -U
222 $ hg clone http://localhost:$HGPORT2/#default http-clone -U
223 adding changesets
223 adding changesets
224 adding manifests
224 adding manifests
225 adding file changes
225 adding file changes
226 added 1 changesets with 1 changes to 1 files
226 added 1 changesets with 1 changes to 1 files
227
227
228 Archive contains largefiles
228 Archive contains largefiles
229 >>> import urllib2, os
229 >>> import os
230 >>> import urllib2
230 >>> u = 'http://localhost:%s/archive/default.zip' % os.environ['HGPORT2']
231 >>> u = 'http://localhost:%s/archive/default.zip' % os.environ['HGPORT2']
231 >>> with open('archive.zip', 'w') as f:
232 >>> with open('archive.zip', 'w') as f:
232 ... f.write(urllib2.urlopen(u).read())
233 ... f.write(urllib2.urlopen(u).read())
233 $ unzip -t archive.zip
234 $ unzip -t archive.zip
234 Archive: archive.zip
235 Archive: archive.zip
235 testing: empty-default/.hg_archival.txt*OK (glob)
236 testing: empty-default/.hg_archival.txt*OK (glob)
236 testing: empty-default/f1*OK (glob)
237 testing: empty-default/f1*OK (glob)
237 No errors detected in compressed data of archive.zip.
238 No errors detected in compressed data of archive.zip.
238
239
239 test 'verify' with remotestore:
240 test 'verify' with remotestore:
240
241
241 $ rm "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90
242 $ rm "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90
242 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
243 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
243 $ hg -R http-clone verify --large --lfa
244 $ hg -R http-clone verify --large --lfa
244 checking changesets
245 checking changesets
245 checking manifests
246 checking manifests
246 crosschecking files in changesets and manifests
247 crosschecking files in changesets and manifests
247 checking files
248 checking files
248 1 files, 1 changesets, 1 total revisions
249 1 files, 1 changesets, 1 total revisions
249 searching 1 changesets for largefiles
250 searching 1 changesets for largefiles
250 changeset 0:cf03e5bb9936: f1 missing
251 changeset 0:cf03e5bb9936: f1 missing
251 verified existence of 1 revisions of 1 largefiles
252 verified existence of 1 revisions of 1 largefiles
252 [1]
253 [1]
253 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
254 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
254 $ hg -R http-clone -q verify --large --lfa
255 $ hg -R http-clone -q verify --large --lfa
255
256
256 largefiles pulled on update - a largefile missing on the server:
257 largefiles pulled on update - a largefile missing on the server:
257 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
258 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
258 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
259 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
259 getting changed largefiles
260 getting changed largefiles
260 f1: largefile 02a439e5c31c526465ab1a0ca1f431f76b827b90 not available from http://localhost:$HGPORT2/
261 f1: largefile 02a439e5c31c526465ab1a0ca1f431f76b827b90 not available from http://localhost:$HGPORT2/
261 0 largefiles updated, 0 removed
262 0 largefiles updated, 0 removed
262 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
263 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
263 $ hg -R http-clone st
264 $ hg -R http-clone st
264 ! f1
265 ! f1
265 $ hg -R http-clone up -Cqr null
266 $ hg -R http-clone up -Cqr null
266
267
267 largefiles pulled on update - a largefile corrupted on the server:
268 largefiles pulled on update - a largefile corrupted on the server:
268 $ echo corruption > empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90
269 $ echo corruption > empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90
269 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
270 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
270 getting changed largefiles
271 getting changed largefiles
271 f1: data corruption (expected 02a439e5c31c526465ab1a0ca1f431f76b827b90, got 6a7bb2556144babe3899b25e5428123735bb1e27)
272 f1: data corruption (expected 02a439e5c31c526465ab1a0ca1f431f76b827b90, got 6a7bb2556144babe3899b25e5428123735bb1e27)
272 0 largefiles updated, 0 removed
273 0 largefiles updated, 0 removed
273 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
274 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
274 $ hg -R http-clone st
275 $ hg -R http-clone st
275 ! f1
276 ! f1
276 $ [ ! -f http-clone/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
277 $ [ ! -f http-clone/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
277 $ [ ! -f http-clone/f1 ]
278 $ [ ! -f http-clone/f1 ]
278 $ [ ! -f http-clone-usercache ]
279 $ [ ! -f http-clone-usercache ]
279 $ hg -R http-clone verify --large --lfc
280 $ hg -R http-clone verify --large --lfc
280 checking changesets
281 checking changesets
281 checking manifests
282 checking manifests
282 crosschecking files in changesets and manifests
283 crosschecking files in changesets and manifests
283 checking files
284 checking files
284 1 files, 1 changesets, 1 total revisions
285 1 files, 1 changesets, 1 total revisions
285 searching 1 changesets for largefiles
286 searching 1 changesets for largefiles
286 verified contents of 1 revisions of 1 largefiles
287 verified contents of 1 revisions of 1 largefiles
287 $ hg -R http-clone up -Cqr null
288 $ hg -R http-clone up -Cqr null
288
289
289 largefiles pulled on update - no server side problems:
290 largefiles pulled on update - no server side problems:
290 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
291 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
291 $ hg -R http-clone --debug up --config largefiles.usercache=http-clone-usercache --config progress.debug=true
292 $ hg -R http-clone --debug up --config largefiles.usercache=http-clone-usercache --config progress.debug=true
292 resolving manifests
293 resolving manifests
293 branchmerge: False, force: False, partial: False
294 branchmerge: False, force: False, partial: False
294 ancestor: 000000000000, local: 000000000000+, remote: cf03e5bb9936
295 ancestor: 000000000000, local: 000000000000+, remote: cf03e5bb9936
295 .hglf/f1: remote created -> g
296 .hglf/f1: remote created -> g
296 getting .hglf/f1
297 getting .hglf/f1
297 updating: .hglf/f1 1/1 files (100.00%)
298 updating: .hglf/f1 1/1 files (100.00%)
298 getting changed largefiles
299 getting changed largefiles
299 using http://localhost:$HGPORT2/
300 using http://localhost:$HGPORT2/
300 sending capabilities command
301 sending capabilities command
301 sending batch command
302 sending batch command
302 getting largefiles: 0/1 files (0.00%)
303 getting largefiles: 0/1 files (0.00%)
303 getting f1:02a439e5c31c526465ab1a0ca1f431f76b827b90
304 getting f1:02a439e5c31c526465ab1a0ca1f431f76b827b90
304 sending getlfile command
305 sending getlfile command
305 found 02a439e5c31c526465ab1a0ca1f431f76b827b90 in store
306 found 02a439e5c31c526465ab1a0ca1f431f76b827b90 in store
306 1 largefiles updated, 0 removed
307 1 largefiles updated, 0 removed
307 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
308 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
308
309
309 $ ls http-clone-usercache/*
310 $ ls http-clone-usercache/*
310 http-clone-usercache/02a439e5c31c526465ab1a0ca1f431f76b827b90
311 http-clone-usercache/02a439e5c31c526465ab1a0ca1f431f76b827b90
311
312
312 $ rm -rf empty http-clone*
313 $ rm -rf empty http-clone*
313
314
314 used all HGPORTs, kill all daemons
315 used all HGPORTs, kill all daemons
315 $ killdaemons.py
316 $ killdaemons.py
316
317
317 largefiles should batch verify remote calls
318 largefiles should batch verify remote calls
318
319
319 $ hg init batchverifymain
320 $ hg init batchverifymain
320 $ cd batchverifymain
321 $ cd batchverifymain
321 $ echo "aaa" >> a
322 $ echo "aaa" >> a
322 $ hg add --large a
323 $ hg add --large a
323 $ hg commit -m "a"
324 $ hg commit -m "a"
324 Invoking status precommit hook
325 Invoking status precommit hook
325 A a
326 A a
326 $ echo "bbb" >> b
327 $ echo "bbb" >> b
327 $ hg add --large b
328 $ hg add --large b
328 $ hg commit -m "b"
329 $ hg commit -m "b"
329 Invoking status precommit hook
330 Invoking status precommit hook
330 A b
331 A b
331 $ cd ..
332 $ cd ..
332 $ hg serve -R batchverifymain -d -p $HGPORT --pid-file hg.pid \
333 $ hg serve -R batchverifymain -d -p $HGPORT --pid-file hg.pid \
333 > -A access.log
334 > -A access.log
334 $ cat hg.pid >> $DAEMON_PIDS
335 $ cat hg.pid >> $DAEMON_PIDS
335 $ hg clone --noupdate http://localhost:$HGPORT batchverifyclone
336 $ hg clone --noupdate http://localhost:$HGPORT batchverifyclone
336 requesting all changes
337 requesting all changes
337 adding changesets
338 adding changesets
338 adding manifests
339 adding manifests
339 adding file changes
340 adding file changes
340 added 2 changesets with 2 changes to 2 files
341 added 2 changesets with 2 changes to 2 files
341 $ hg -R batchverifyclone verify --large --lfa
342 $ hg -R batchverifyclone verify --large --lfa
342 checking changesets
343 checking changesets
343 checking manifests
344 checking manifests
344 crosschecking files in changesets and manifests
345 crosschecking files in changesets and manifests
345 checking files
346 checking files
346 2 files, 2 changesets, 2 total revisions
347 2 files, 2 changesets, 2 total revisions
347 searching 2 changesets for largefiles
348 searching 2 changesets for largefiles
348 verified existence of 2 revisions of 2 largefiles
349 verified existence of 2 revisions of 2 largefiles
349 $ tail -1 access.log
350 $ tail -1 access.log
350 $LOCALIP - - [*] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=statlfile+sha%3D972a1a11f19934401291cc99117ec614933374ce%3Bstatlfile+sha%3Dc801c9cfe94400963fcb683246217d5db77f9a9a x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
351 $LOCALIP - - [*] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=statlfile+sha%3D972a1a11f19934401291cc99117ec614933374ce%3Bstatlfile+sha%3Dc801c9cfe94400963fcb683246217d5db77f9a9a x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
351 $ hg -R batchverifyclone update
352 $ hg -R batchverifyclone update
352 getting changed largefiles
353 getting changed largefiles
353 2 largefiles updated, 0 removed
354 2 largefiles updated, 0 removed
354 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
355 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
355
356
356 Clear log file before next test
357 Clear log file before next test
357
358
358 $ printf "" > access.log
359 $ printf "" > access.log
359
360
360 Verify should check file on remote server only when file is not
361 Verify should check file on remote server only when file is not
361 available locally.
362 available locally.
362
363
363 $ echo "ccc" >> batchverifymain/c
364 $ echo "ccc" >> batchverifymain/c
364 $ hg -R batchverifymain status
365 $ hg -R batchverifymain status
365 ? c
366 ? c
366 $ hg -R batchverifymain add --large batchverifymain/c
367 $ hg -R batchverifymain add --large batchverifymain/c
367 $ hg -R batchverifymain commit -m "c"
368 $ hg -R batchverifymain commit -m "c"
368 Invoking status precommit hook
369 Invoking status precommit hook
369 A c
370 A c
370 $ hg -R batchverifyclone pull
371 $ hg -R batchverifyclone pull
371 pulling from http://localhost:$HGPORT/
372 pulling from http://localhost:$HGPORT/
372 searching for changes
373 searching for changes
373 adding changesets
374 adding changesets
374 adding manifests
375 adding manifests
375 adding file changes
376 adding file changes
376 added 1 changesets with 1 changes to 1 files
377 added 1 changesets with 1 changes to 1 files
377 (run 'hg update' to get a working copy)
378 (run 'hg update' to get a working copy)
378 $ hg -R batchverifyclone verify --lfa
379 $ hg -R batchverifyclone verify --lfa
379 checking changesets
380 checking changesets
380 checking manifests
381 checking manifests
381 crosschecking files in changesets and manifests
382 crosschecking files in changesets and manifests
382 checking files
383 checking files
383 3 files, 3 changesets, 3 total revisions
384 3 files, 3 changesets, 3 total revisions
384 searching 3 changesets for largefiles
385 searching 3 changesets for largefiles
385 verified existence of 3 revisions of 3 largefiles
386 verified existence of 3 revisions of 3 largefiles
386 $ tail -1 access.log
387 $ tail -1 access.log
387 $LOCALIP - - [*] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=statlfile+sha%3Dc8559c3c9cfb42131794b7d8009230403b9b454c x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
388 $LOCALIP - - [*] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=statlfile+sha%3Dc8559c3c9cfb42131794b7d8009230403b9b454c x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
388
389
389 $ killdaemons.py
390 $ killdaemons.py
390
391
391 largefiles should not ask for password again after successful authorization
392 largefiles should not ask for password again after successful authorization
392
393
393 $ hg init credentialmain
394 $ hg init credentialmain
394 $ cd credentialmain
395 $ cd credentialmain
395 $ echo "aaa" >> a
396 $ echo "aaa" >> a
396 $ hg add --large a
397 $ hg add --large a
397 $ hg commit -m "a"
398 $ hg commit -m "a"
398 Invoking status precommit hook
399 Invoking status precommit hook
399 A a
400 A a
400
401
401 Before running server clear the user cache to force clone to download
402 Before running server clear the user cache to force clone to download
402 a large file from the server rather than to get it from the cache
403 a large file from the server rather than to get it from the cache
403
404
404 $ rm "${USERCACHE}"/*
405 $ rm "${USERCACHE}"/*
405
406
406 $ cd ..
407 $ cd ..
407 $ cat << EOT > userpass.py
408 $ cat << EOT > userpass.py
408 > import base64
409 > import base64
409 > from mercurial.hgweb import common
410 > from mercurial.hgweb import common
410 > def perform_authentication(hgweb, req, op):
411 > def perform_authentication(hgweb, req, op):
411 > auth = req.env.get('HTTP_AUTHORIZATION')
412 > auth = req.env.get('HTTP_AUTHORIZATION')
412 > if not auth:
413 > if not auth:
413 > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, 'who',
414 > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, 'who',
414 > [('WWW-Authenticate', 'Basic Realm="mercurial"')])
415 > [('WWW-Authenticate', 'Basic Realm="mercurial"')])
415 > if base64.b64decode(auth.split()[1]).split(':', 1) != ['user', 'pass']:
416 > if base64.b64decode(auth.split()[1]).split(':', 1) != ['user', 'pass']:
416 > raise common.ErrorResponse(common.HTTP_FORBIDDEN, 'no')
417 > raise common.ErrorResponse(common.HTTP_FORBIDDEN, 'no')
417 > def extsetup():
418 > def extsetup():
418 > common.permhooks.insert(0, perform_authentication)
419 > common.permhooks.insert(0, perform_authentication)
419 > EOT
420 > EOT
420 $ hg serve --config extensions.x=userpass.py -R credentialmain \
421 $ hg serve --config extensions.x=userpass.py -R credentialmain \
421 > -d -p $HGPORT --pid-file hg.pid -A access.log
422 > -d -p $HGPORT --pid-file hg.pid -A access.log
422 $ cat hg.pid >> $DAEMON_PIDS
423 $ cat hg.pid >> $DAEMON_PIDS
423 $ cat << EOF > get_pass.py
424 $ cat << EOF > get_pass.py
424 > import getpass
425 > import getpass
425 > def newgetpass(arg):
426 > def newgetpass(arg):
426 > return "pass"
427 > return "pass"
427 > getpass.getpass = newgetpass
428 > getpass.getpass = newgetpass
428 > EOF
429 > EOF
429 $ hg clone --config ui.interactive=true --config extensions.getpass=get_pass.py \
430 $ hg clone --config ui.interactive=true --config extensions.getpass=get_pass.py \
430 > http://user@localhost:$HGPORT credentialclone
431 > http://user@localhost:$HGPORT credentialclone
431 requesting all changes
432 requesting all changes
432 http authorization required for http://localhost:$HGPORT/
433 http authorization required for http://localhost:$HGPORT/
433 realm: mercurial
434 realm: mercurial
434 user: user
435 user: user
435 password: adding changesets
436 password: adding changesets
436 adding manifests
437 adding manifests
437 adding file changes
438 adding file changes
438 added 1 changesets with 1 changes to 1 files
439 added 1 changesets with 1 changes to 1 files
439 updating to branch default
440 updating to branch default
440 getting changed largefiles
441 getting changed largefiles
441 1 largefiles updated, 0 removed
442 1 largefiles updated, 0 removed
442 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
443 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
443
444
444 $ killdaemons.py
445 $ killdaemons.py
445 $ rm hg.pid access.log
446 $ rm hg.pid access.log
446
447
447 #endif
448 #endif
General Comments 0
You need to be logged in to leave comments. Login now