##// END OF EJS Templates
stream-clone-test: simplify the background file closing test...
marmoute -
r52370:d42006e0 default
parent child Browse files
Show More
@@ -1,785 +1,705
1 #require serve no-reposimplestore no-chg
1 #require serve no-reposimplestore no-chg
2
2
3 #testcases stream-legacy stream-bundle2-v2 stream-bundle2-v3
3 #testcases stream-legacy stream-bundle2-v2 stream-bundle2-v3
4
4
5 #if stream-legacy
5 #if stream-legacy
6 $ cat << EOF >> $HGRCPATH
6 $ cat << EOF >> $HGRCPATH
7 > [server]
7 > [server]
8 > bundle2.stream = no
8 > bundle2.stream = no
9 > [format]
9 > [format]
10 > # persistent nodemap is too broken with legacy format,
10 > # persistent nodemap is too broken with legacy format,
11 > # however client with nodemap support will have better stream support.
11 > # however client with nodemap support will have better stream support.
12 > use-persistent-nodemap=no
12 > use-persistent-nodemap=no
13 > EOF
13 > EOF
14 #endif
14 #endif
15 #if stream-bundle2-v3
15 #if stream-bundle2-v3
16 $ cat << EOF >> $HGRCPATH
16 $ cat << EOF >> $HGRCPATH
17 > [experimental]
17 > [experimental]
18 > stream-v3 = yes
18 > stream-v3 = yes
19 > EOF
19 > EOF
20 #endif
20 #endif
21
21
22 Initialize repository
22 Initialize repository
23
23
24 $ hg init server
24 $ hg init server
25 $ cd server
25 $ cd server
26 $ sh $TESTDIR/testlib/stream_clone_setup.sh
26 $ sh $TESTDIR/testlib/stream_clone_setup.sh
27 adding 00changelog-ab349180a0405010.nd
27 adding 00changelog-ab349180a0405010.nd
28 adding 00changelog.d
28 adding 00changelog.d
29 adding 00changelog.i
29 adding 00changelog.i
30 adding 00changelog.n
30 adding 00changelog.n
31 adding 00manifest.d
31 adding 00manifest.d
32 adding 00manifest.i
32 adding 00manifest.i
33 adding container/isam-build-centos7/bazel-coverage-generator-sandboxfs-compatibility-0758e3e4f6057904d44399bd666faba9e7f40686.patch
33 adding container/isam-build-centos7/bazel-coverage-generator-sandboxfs-compatibility-0758e3e4f6057904d44399bd666faba9e7f40686.patch
34 adding data/foo.d
34 adding data/foo.d
35 adding data/foo.i
35 adding data/foo.i
36 adding data/foo.n
36 adding data/foo.n
37 adding data/undo.babar
37 adding data/undo.babar
38 adding data/undo.d
38 adding data/undo.d
39 adding data/undo.foo.d
39 adding data/undo.foo.d
40 adding data/undo.foo.i
40 adding data/undo.foo.i
41 adding data/undo.foo.n
41 adding data/undo.foo.n
42 adding data/undo.i
42 adding data/undo.i
43 adding data/undo.n
43 adding data/undo.n
44 adding data/undo.py
44 adding data/undo.py
45 adding foo.d
45 adding foo.d
46 adding foo.i
46 adding foo.i
47 adding foo.n
47 adding foo.n
48 adding meta/foo.d
48 adding meta/foo.d
49 adding meta/foo.i
49 adding meta/foo.i
50 adding meta/foo.n
50 adding meta/foo.n
51 adding meta/undo.babar
51 adding meta/undo.babar
52 adding meta/undo.d
52 adding meta/undo.d
53 adding meta/undo.foo.d
53 adding meta/undo.foo.d
54 adding meta/undo.foo.i
54 adding meta/undo.foo.i
55 adding meta/undo.foo.n
55 adding meta/undo.foo.n
56 adding meta/undo.i
56 adding meta/undo.i
57 adding meta/undo.n
57 adding meta/undo.n
58 adding meta/undo.py
58 adding meta/undo.py
59 adding savanah/foo.d
59 adding savanah/foo.d
60 adding savanah/foo.i
60 adding savanah/foo.i
61 adding savanah/foo.n
61 adding savanah/foo.n
62 adding savanah/undo.babar
62 adding savanah/undo.babar
63 adding savanah/undo.d
63 adding savanah/undo.d
64 adding savanah/undo.foo.d
64 adding savanah/undo.foo.d
65 adding savanah/undo.foo.i
65 adding savanah/undo.foo.i
66 adding savanah/undo.foo.n
66 adding savanah/undo.foo.n
67 adding savanah/undo.i
67 adding savanah/undo.i
68 adding savanah/undo.n
68 adding savanah/undo.n
69 adding savanah/undo.py
69 adding savanah/undo.py
70 adding store/C\xc3\xa9lesteVille_is_a_Capital_City (esc)
70 adding store/C\xc3\xa9lesteVille_is_a_Capital_City (esc)
71 adding store/foo.d
71 adding store/foo.d
72 adding store/foo.i
72 adding store/foo.i
73 adding store/foo.n
73 adding store/foo.n
74 adding store/undo.babar
74 adding store/undo.babar
75 adding store/undo.d
75 adding store/undo.d
76 adding store/undo.foo.d
76 adding store/undo.foo.d
77 adding store/undo.foo.i
77 adding store/undo.foo.i
78 adding store/undo.foo.n
78 adding store/undo.foo.n
79 adding store/undo.i
79 adding store/undo.i
80 adding store/undo.n
80 adding store/undo.n
81 adding store/undo.py
81 adding store/undo.py
82 adding undo.babar
82 adding undo.babar
83 adding undo.d
83 adding undo.d
84 adding undo.foo.d
84 adding undo.foo.d
85 adding undo.foo.i
85 adding undo.foo.i
86 adding undo.foo.n
86 adding undo.foo.n
87 adding undo.i
87 adding undo.i
88 adding undo.n
88 adding undo.n
89 adding undo.py
89 adding undo.py
90
90
91 $ hg --config server.uncompressed=false serve -p $HGPORT -d --pid-file=hg.pid
91 $ hg --config server.uncompressed=false serve -p $HGPORT -d --pid-file=hg.pid
92 $ cat hg.pid > $DAEMON_PIDS
92 $ cat hg.pid > $DAEMON_PIDS
93 $ cd ..
93 $ cd ..
94
94
95 Check local clone
95 Check local clone
96 ==================
96 ==================
97
97
98 The logic is close enough of uncompressed.
98 The logic is close enough of uncompressed.
99 This is present here to reuse the testing around file with "special" names.
99 This is present here to reuse the testing around file with "special" names.
100
100
101 $ hg clone server local-clone
101 $ hg clone server local-clone
102 updating to branch default
102 updating to branch default
103 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
103 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
104
104
105 Check that the clone went well
105 Check that the clone went well
106
106
107 $ hg verify -R local-clone -q
107 $ hg verify -R local-clone -q
108
108
109 Check uncompressed
109 Check uncompressed
110 ==================
110 ==================
111
111
112 Cannot stream clone when server.uncompressed is set to false
112 Cannot stream clone when server.uncompressed is set to false
113 ------------------------------------------------------------
113 ------------------------------------------------------------
114
114
115 When `server.uncompressed` is disabled, the client should fallback to a bundle
115 When `server.uncompressed` is disabled, the client should fallback to a bundle
116 based clone with a warning.
116 based clone with a warning.
117
117
118
118
119 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=stream_out'
119 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=stream_out'
120 200 Script output follows
120 200 Script output follows
121
121
122 1
122 1
123
123
124 $ hg debugcapabilities http://localhost:$HGPORT
124 $ hg debugcapabilities http://localhost:$HGPORT
125 Main capabilities:
125 Main capabilities:
126 batch
126 batch
127 branchmap
127 branchmap
128 $USUAL_BUNDLE2_CAPS_SERVER$
128 $USUAL_BUNDLE2_CAPS_SERVER$
129 changegroupsubset
129 changegroupsubset
130 compression=$BUNDLE2_COMPRESSIONS$
130 compression=$BUNDLE2_COMPRESSIONS$
131 getbundle
131 getbundle
132 httpheader=1024
132 httpheader=1024
133 httpmediatype=0.1rx,0.1tx,0.2tx
133 httpmediatype=0.1rx,0.1tx,0.2tx
134 known
134 known
135 lookup
135 lookup
136 pushkey
136 pushkey
137 unbundle=HG10GZ,HG10BZ,HG10UN
137 unbundle=HG10GZ,HG10BZ,HG10UN
138 unbundlehash
138 unbundlehash
139 Bundle2 capabilities:
139 Bundle2 capabilities:
140 HG20
140 HG20
141 bookmarks
141 bookmarks
142 changegroup
142 changegroup
143 01
143 01
144 02
144 02
145 03
145 03
146 checkheads
146 checkheads
147 related
147 related
148 digests
148 digests
149 md5
149 md5
150 sha1
150 sha1
151 sha512
151 sha512
152 error
152 error
153 abort
153 abort
154 unsupportedcontent
154 unsupportedcontent
155 pushraced
155 pushraced
156 pushkey
156 pushkey
157 hgtagsfnodes
157 hgtagsfnodes
158 listkeys
158 listkeys
159 phases
159 phases
160 heads
160 heads
161 pushkey
161 pushkey
162 remote-changegroup
162 remote-changegroup
163 http
163 http
164 https
164 https
165
165
166 $ hg clone --stream -U http://localhost:$HGPORT server-disabled
166 $ hg clone --stream -U http://localhost:$HGPORT server-disabled
167 warning: stream clone requested but server has them disabled
167 warning: stream clone requested but server has them disabled
168 requesting all changes
168 requesting all changes
169 adding changesets
169 adding changesets
170 adding manifests
170 adding manifests
171 adding file changes
171 adding file changes
172 added 3 changesets with 1088 changes to 1088 files
172 added 3 changesets with 1088 changes to 1088 files
173 new changesets 96ee1d7354c4:5223b5e3265f
173 new changesets 96ee1d7354c4:5223b5e3265f
174
174
175 $ killdaemons.py
175 $ killdaemons.py
176 $ cd server
176 $ cd server
177 $ hg serve -p $HGPORT -d --pid-file=hg.pid --error errors.txt
177 $ hg serve -p $HGPORT -d --pid-file=hg.pid --error errors.txt
178 $ cat hg.pid > $DAEMON_PIDS
178 $ cat hg.pid > $DAEMON_PIDS
179 $ cd ..
179 $ cd ..
180
180
181 Basic clone
181 Basic clone
182 -----------
182 -----------
183
183
184 Check that --stream trigger a stream clone and result in a valid repositoty
184 Check that --stream trigger a stream clone and result in a valid repositoty
185
185
186 We check the associated output for exact bytes on file number as changes in
186 We check the associated output for exact bytes on file number as changes in
187 these value implies changes in the data transfered and can detect unintended
187 these value implies changes in the data transfered and can detect unintended
188 changes in the process.
188 changes in the process.
189
189
190 #if stream-legacy
190 #if stream-legacy
191 $ hg clone --stream -U http://localhost:$HGPORT clone1
191 $ hg clone --stream -U http://localhost:$HGPORT clone1
192 streaming all changes
192 streaming all changes
193 1091 files to transfer, 102 KB of data (no-zstd !)
193 1091 files to transfer, 102 KB of data (no-zstd !)
194 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
194 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
195 1091 files to transfer, 98.8 KB of data (zstd !)
195 1091 files to transfer, 98.8 KB of data (zstd !)
196 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
196 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
197 searching for changes
197 searching for changes
198 no changes found
198 no changes found
199 #endif
199 #endif
200 #if stream-bundle2-v2
200 #if stream-bundle2-v2
201 $ hg clone --stream -U http://localhost:$HGPORT clone1
201 $ hg clone --stream -U http://localhost:$HGPORT clone1
202 streaming all changes
202 streaming all changes
203 1094 files to transfer, 102 KB of data (no-zstd !)
203 1094 files to transfer, 102 KB of data (no-zstd !)
204 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
204 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
205 1094 files to transfer, 98.9 KB of data (zstd no-rust !)
205 1094 files to transfer, 98.9 KB of data (zstd no-rust !)
206 transferred 98.9 KB in * seconds (* */sec) (glob) (zstd no-rust !)
206 transferred 98.9 KB in * seconds (* */sec) (glob) (zstd no-rust !)
207 1096 files to transfer, 99.0 KB of data (zstd rust !)
207 1096 files to transfer, 99.0 KB of data (zstd rust !)
208 transferred 99.0 KB in * seconds (* */sec) (glob) (zstd rust !)
208 transferred 99.0 KB in * seconds (* */sec) (glob) (zstd rust !)
209 #endif
209 #endif
210
210
211 #if stream-bundle2-v3
211 #if stream-bundle2-v3
212 $ hg clone --stream -U http://localhost:$HGPORT clone1
212 $ hg clone --stream -U http://localhost:$HGPORT clone1
213 streaming all changes
213 streaming all changes
214 1093 entries to transfer
214 1093 entries to transfer
215 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
215 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
216 transferred 98.9 KB in * seconds (* */sec) (glob) (zstd no-rust !)
216 transferred 98.9 KB in * seconds (* */sec) (glob) (zstd no-rust !)
217 transferred 99.0 KB in * seconds (* */sec) (glob) (zstd rust !)
217 transferred 99.0 KB in * seconds (* */sec) (glob) (zstd rust !)
218 #endif
218 #endif
219
219
220 #if no-stream-legacy
220 #if no-stream-legacy
221 $ ls -1 clone1/.hg/cache
221 $ ls -1 clone1/.hg/cache
222 branch2-base
222 branch2-base
223 branch2-immutable
223 branch2-immutable
224 branch2-served
224 branch2-served
225 branch2-served.hidden
225 branch2-served.hidden
226 branch2-visible
226 branch2-visible
227 branch2-visible-hidden
227 branch2-visible-hidden
228 rbc-names-v1
228 rbc-names-v1
229 rbc-revs-v1
229 rbc-revs-v1
230 tags2
230 tags2
231 tags2-served
231 tags2-served
232 #endif
232 #endif
233
233
234 $ hg -R clone1 verify --quiet
234 $ hg -R clone1 verify --quiet
235 $ cat server/errors.txt
235 $ cat server/errors.txt
236
236
237 getbundle requests with stream=1 are uncompressed
237 getbundle requests with stream=1 are uncompressed
238 -------------------------------------------------
238 -------------------------------------------------
239
239
240 We check that `getbundle` will return a stream bundle when requested.
240 We check that `getbundle` will return a stream bundle when requested.
241
241
242 XXX manually building the --requestheader is fragile and will drift away from actual usage
242 XXX manually building the --requestheader is fragile and will drift away from actual usage
243
243
244 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle' content-type --bodyfile body --hgproto '0.1 0.2 comp=zlib,none' --requestheader "x-hgarg-1=bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%252C03%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps%250Astream%253Dv2&cg=0&common=0000000000000000000000000000000000000000&heads=c17445101a72edac06facd130d14808dfbd5c7c2&stream=1"
244 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle' content-type --bodyfile body --hgproto '0.1 0.2 comp=zlib,none' --requestheader "x-hgarg-1=bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%252C03%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps%250Astream%253Dv2&cg=0&common=0000000000000000000000000000000000000000&heads=c17445101a72edac06facd130d14808dfbd5c7c2&stream=1"
245 200 Script output follows
245 200 Script output follows
246 content-type: application/mercurial-0.2
246 content-type: application/mercurial-0.2
247
247
248
248
249 $ f --size --hex --bytes 48 body
249 $ f --size --hex --bytes 48 body
250 body: size=* (glob)
250 body: size=* (glob)
251 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
251 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
252 0010: ?? 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 |?.STREAM2.......| (glob)
252 0010: ?? 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 |?.STREAM2.......| (glob)
253 0020: 06 09 04 0c ?? 62 79 74 65 63 6f 75 6e 74 31 30 |....?bytecount10| (glob)
253 0020: 06 09 04 0c ?? 62 79 74 65 63 6f 75 6e 74 31 30 |....?bytecount10| (glob)
254
254
255 --uncompressed is an alias to --stream
255 --uncompressed is an alias to --stream
256 ---------------------------------------
256 ---------------------------------------
257
257
258 The alias flag should trigger a stream clone too.
258 The alias flag should trigger a stream clone too.
259
259
260 $ hg clone --uncompressed -U http://localhost:$HGPORT clone1-uncompressed
260 $ hg clone --uncompressed -U http://localhost:$HGPORT clone1-uncompressed
261 streaming all changes
261 streaming all changes
262 * files to transfer* (glob) (no-stream-bundle2-v3 !)
262 * files to transfer* (glob) (no-stream-bundle2-v3 !)
263 * entries to transfer (glob) (stream-bundle2-v3 !)
263 * entries to transfer (glob) (stream-bundle2-v3 !)
264 transferred * KB in * seconds (* */sec) (glob)
264 transferred * KB in * seconds (* */sec) (glob)
265 searching for changes (stream-legacy !)
265 searching for changes (stream-legacy !)
266 no changes found (stream-legacy !)
266 no changes found (stream-legacy !)
267
267
268 Clone with background file closing enabled
268 Clone with background file closing enabled
269 -------------------------------------------
269
270
270 #if stream-legacy
271 The backgound file closing logic should trigger when configured to do so, and
271 $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep -v adding
272 the result should be a valid repository.
272 using http://localhost:$HGPORT/
273
273 sending capabilities command
274 $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep "background file closing"
274 sending branchmap command
275 streaming all changes
276 sending stream_out command
277 1091 files to transfer, 102 KB of data (no-zstd !)
278 1091 files to transfer, 98.8 KB of data (zstd !)
279 starting 4 threads for background file closing
280 updating the branch cache
281 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
282 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
283 query 1; heads
284 sending batch command
285 searching for changes
286 all remote heads known locally
287 no changes found
288 sending getbundle command
289 bundle2-input-bundle: with-transaction
290 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
291 bundle2-input-part: "phase-heads" supported
292 bundle2-input-part: total payload size 24
293 bundle2-input-bundle: 2 parts total
294 checking for updated bookmarks
295 updating the branch cache
296 (sent 5 HTTP requests and * bytes; received * bytes in responses) (glob)
297 #endif
298 #if stream-bundle2-v2
299 $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep -v adding
300 using http://localhost:$HGPORT/
301 sending capabilities command
302 query 1; heads
303 sending batch command
304 streaming all changes
305 sending getbundle command
306 bundle2-input-bundle: with-transaction
307 bundle2-input-part: "stream2" (params: 3 mandatory) supported
308 applying stream bundle
309 1094 files to transfer, 102 KB of data (no-zstd !)
310 1094 files to transfer, 98.9 KB of data (zstd no-rust !)
311 1096 files to transfer, 99.0 KB of data (zstd rust !)
312 starting 4 threads for background file closing
313 starting 4 threads for background file closing
275 starting 4 threads for background file closing
314 updating the branch cache
276 starting 4 threads for background file closing (no-stream-legacy !)
315 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
277 $ hg verify -R clone-background --quiet
316 bundle2-input-part: total payload size 119001 (no-zstd !)
317 transferred 98.9 KB in * seconds (* */sec) (glob) (zstd no-rust !)
318 transferred 99.0 KB in * seconds (* */sec) (glob) (zstd rust !)
319 bundle2-input-part: total payload size 116162 (zstd no-bigendian no-rust !)
320 bundle2-input-part: total payload size 116330 (zstd no-bigendian rust !)
321 bundle2-input-part: total payload size 116157 (zstd bigendian no-rust !)
322 bundle2-input-part: total payload size 116325 (zstd bigendian rust !)
323 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
324 bundle2-input-bundle: 2 parts total
325 checking for updated bookmarks
326 updating the branch cache
327 (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
328 #endif
329 #if stream-bundle2-v3
330 $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep -v adding
331 using http://localhost:$HGPORT/
332 sending capabilities command
333 query 1; heads
334 sending batch command
335 streaming all changes
336 sending getbundle command
337 bundle2-input-bundle: with-transaction
338 bundle2-input-part: "stream3-exp" (params: 1 mandatory) supported
339 applying stream bundle
340 1093 entries to transfer
341 starting 4 threads for background file closing
342 starting 4 threads for background file closing
343 updating the branch cache
344 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
345 bundle2-input-part: total payload size 120096 (no-zstd !)
346 transferred 98.9 KB in * seconds (* */sec) (glob) (zstd no-rust !)
347 transferred 99.0 KB in * seconds (* */sec) (glob) (zstd rust !)
348 bundle2-input-part: total payload size 117257 (zstd no-rust no-bigendian !)
349 bundle2-input-part: total payload size 117425 (zstd rust no-bigendian !)
350 bundle2-input-part: total payload size 117252 (zstd bigendian no-rust !)
351 bundle2-input-part: total payload size 117420 (zstd bigendian rust !)
352 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
353 bundle2-input-bundle: 2 parts total
354 checking for updated bookmarks
355 updating the branch cache
356 (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
357 #endif
358
278
359 Cannot stream clone when there are secret changesets
279 Cannot stream clone when there are secret changesets
360
280
361 $ hg -R server phase --force --secret -r tip
281 $ hg -R server phase --force --secret -r tip
362 $ hg clone --stream -U http://localhost:$HGPORT secret-denied
282 $ hg clone --stream -U http://localhost:$HGPORT secret-denied
363 warning: stream clone requested but server has them disabled
283 warning: stream clone requested but server has them disabled
364 requesting all changes
284 requesting all changes
365 adding changesets
285 adding changesets
366 adding manifests
286 adding manifests
367 adding file changes
287 adding file changes
368 added 2 changesets with 1025 changes to 1025 files
288 added 2 changesets with 1025 changes to 1025 files
369 new changesets 96ee1d7354c4:c17445101a72
289 new changesets 96ee1d7354c4:c17445101a72
370
290
371 $ killdaemons.py
291 $ killdaemons.py
372
292
373 Streaming of secrets can be overridden by server config
293 Streaming of secrets can be overridden by server config
374
294
375 $ cd server
295 $ cd server
376 $ hg serve --config server.uncompressedallowsecret=true -p $HGPORT -d --pid-file=hg.pid
296 $ hg serve --config server.uncompressedallowsecret=true -p $HGPORT -d --pid-file=hg.pid
377 $ cat hg.pid > $DAEMON_PIDS
297 $ cat hg.pid > $DAEMON_PIDS
378 $ cd ..
298 $ cd ..
379
299
380 #if stream-legacy
300 #if stream-legacy
381 $ hg clone --stream -U http://localhost:$HGPORT secret-allowed
301 $ hg clone --stream -U http://localhost:$HGPORT secret-allowed
382 streaming all changes
302 streaming all changes
383 1091 files to transfer, 102 KB of data (no-zstd !)
303 1091 files to transfer, 102 KB of data (no-zstd !)
384 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
304 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
385 1091 files to transfer, 98.8 KB of data (zstd !)
305 1091 files to transfer, 98.8 KB of data (zstd !)
386 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
306 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
387 searching for changes
307 searching for changes
388 no changes found
308 no changes found
389 #endif
309 #endif
390 #if stream-bundle2-v2
310 #if stream-bundle2-v2
391 $ hg clone --stream -U http://localhost:$HGPORT secret-allowed
311 $ hg clone --stream -U http://localhost:$HGPORT secret-allowed
392 streaming all changes
312 streaming all changes
393 1094 files to transfer, 102 KB of data (no-zstd !)
313 1094 files to transfer, 102 KB of data (no-zstd !)
394 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
314 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
395 1094 files to transfer, 98.9 KB of data (zstd no-rust !)
315 1094 files to transfer, 98.9 KB of data (zstd no-rust !)
396 transferred 98.9 KB in * seconds (* */sec) (glob) (zstd no-rust !)
316 transferred 98.9 KB in * seconds (* */sec) (glob) (zstd no-rust !)
397 1096 files to transfer, 99.0 KB of data (zstd rust !)
317 1096 files to transfer, 99.0 KB of data (zstd rust !)
398 transferred 99.0 KB in * seconds (* */sec) (glob) (zstd rust !)
318 transferred 99.0 KB in * seconds (* */sec) (glob) (zstd rust !)
399 #endif
319 #endif
400 #if stream-bundle2-v3
320 #if stream-bundle2-v3
401 $ hg clone --stream -U http://localhost:$HGPORT secret-allowed
321 $ hg clone --stream -U http://localhost:$HGPORT secret-allowed
402 streaming all changes
322 streaming all changes
403 1093 entries to transfer
323 1093 entries to transfer
404 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
324 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
405 transferred 98.9 KB in * seconds (* */sec) (glob) (zstd no-rust !)
325 transferred 98.9 KB in * seconds (* */sec) (glob) (zstd no-rust !)
406 transferred 99.0 KB in * seconds (* */sec) (glob) (zstd rust !)
326 transferred 99.0 KB in * seconds (* */sec) (glob) (zstd rust !)
407 #endif
327 #endif
408
328
409 $ killdaemons.py
329 $ killdaemons.py
410
330
411 Verify interaction between preferuncompressed and secret presence
331 Verify interaction between preferuncompressed and secret presence
412
332
413 $ cd server
333 $ cd server
414 $ hg serve --config server.preferuncompressed=true -p $HGPORT -d --pid-file=hg.pid
334 $ hg serve --config server.preferuncompressed=true -p $HGPORT -d --pid-file=hg.pid
415 $ cat hg.pid > $DAEMON_PIDS
335 $ cat hg.pid > $DAEMON_PIDS
416 $ cd ..
336 $ cd ..
417
337
418 $ hg clone -U http://localhost:$HGPORT preferuncompressed-secret
338 $ hg clone -U http://localhost:$HGPORT preferuncompressed-secret
419 requesting all changes
339 requesting all changes
420 adding changesets
340 adding changesets
421 adding manifests
341 adding manifests
422 adding file changes
342 adding file changes
423 added 2 changesets with 1025 changes to 1025 files
343 added 2 changesets with 1025 changes to 1025 files
424 new changesets 96ee1d7354c4:c17445101a72
344 new changesets 96ee1d7354c4:c17445101a72
425
345
426 $ killdaemons.py
346 $ killdaemons.py
427
347
428 Clone not allowed when full bundles disabled and can't serve secrets
348 Clone not allowed when full bundles disabled and can't serve secrets
429
349
430 $ cd server
350 $ cd server
431 $ hg serve --config server.disablefullbundle=true -p $HGPORT -d --pid-file=hg.pid
351 $ hg serve --config server.disablefullbundle=true -p $HGPORT -d --pid-file=hg.pid
432 $ cat hg.pid > $DAEMON_PIDS
352 $ cat hg.pid > $DAEMON_PIDS
433 $ cd ..
353 $ cd ..
434
354
435 $ hg clone --stream http://localhost:$HGPORT secret-full-disabled
355 $ hg clone --stream http://localhost:$HGPORT secret-full-disabled
436 warning: stream clone requested but server has them disabled
356 warning: stream clone requested but server has them disabled
437 requesting all changes
357 requesting all changes
438 remote: abort: server has pull-based clones disabled
358 remote: abort: server has pull-based clones disabled
439 abort: pull failed on remote
359 abort: pull failed on remote
440 (remove --pull if specified or upgrade Mercurial)
360 (remove --pull if specified or upgrade Mercurial)
441 [100]
361 [100]
442
362
443 Local stream clone with secrets involved
363 Local stream clone with secrets involved
444 (This is just a test over behavior: if you have access to the repo's files,
364 (This is just a test over behavior: if you have access to the repo's files,
445 there is no security so it isn't important to prevent a clone here.)
365 there is no security so it isn't important to prevent a clone here.)
446
366
447 $ hg clone -U --stream server local-secret
367 $ hg clone -U --stream server local-secret
448 warning: stream clone requested but server has them disabled
368 warning: stream clone requested but server has them disabled
449 requesting all changes
369 requesting all changes
450 adding changesets
370 adding changesets
451 adding manifests
371 adding manifests
452 adding file changes
372 adding file changes
453 added 2 changesets with 1025 changes to 1025 files
373 added 2 changesets with 1025 changes to 1025 files
454 new changesets 96ee1d7354c4:c17445101a72
374 new changesets 96ee1d7354c4:c17445101a72
455
375
456 Stream clone while repo is changing:
376 Stream clone while repo is changing:
457
377
458 $ mkdir changing
378 $ mkdir changing
459 $ cd changing
379 $ cd changing
460
380
461 prepare repo with small and big file to cover both code paths in emitrevlogdata
381 prepare repo with small and big file to cover both code paths in emitrevlogdata
462
382
463 $ hg init repo
383 $ hg init repo
464 $ touch repo/f1
384 $ touch repo/f1
465 $ $TESTDIR/seq.py 50000 > repo/f2
385 $ $TESTDIR/seq.py 50000 > repo/f2
466 $ hg -R repo ci -Aqm "0"
386 $ hg -R repo ci -Aqm "0"
467 $ HG_TEST_STREAM_WALKED_FILE_1="$TESTTMP/sync_file_walked_1"
387 $ HG_TEST_STREAM_WALKED_FILE_1="$TESTTMP/sync_file_walked_1"
468 $ export HG_TEST_STREAM_WALKED_FILE_1
388 $ export HG_TEST_STREAM_WALKED_FILE_1
469 $ HG_TEST_STREAM_WALKED_FILE_2="$TESTTMP/sync_file_walked_2"
389 $ HG_TEST_STREAM_WALKED_FILE_2="$TESTTMP/sync_file_walked_2"
470 $ export HG_TEST_STREAM_WALKED_FILE_2
390 $ export HG_TEST_STREAM_WALKED_FILE_2
471 $ HG_TEST_STREAM_WALKED_FILE_3="$TESTTMP/sync_file_walked_3"
391 $ HG_TEST_STREAM_WALKED_FILE_3="$TESTTMP/sync_file_walked_3"
472 $ export HG_TEST_STREAM_WALKED_FILE_3
392 $ export HG_TEST_STREAM_WALKED_FILE_3
473 # $ cat << EOF >> $HGRCPATH
393 # $ cat << EOF >> $HGRCPATH
474 # > [hooks]
394 # > [hooks]
475 # > pre-clone=rm -f "$TESTTMP/sync_file_walked_*"
395 # > pre-clone=rm -f "$TESTTMP/sync_file_walked_*"
476 # > EOF
396 # > EOF
477 $ hg serve -R repo -p $HGPORT1 -d --error errors.log --pid-file=hg.pid --config extensions.stream_steps="$RUNTESTDIR/testlib/ext-stream-clone-steps.py"
397 $ hg serve -R repo -p $HGPORT1 -d --error errors.log --pid-file=hg.pid --config extensions.stream_steps="$RUNTESTDIR/testlib/ext-stream-clone-steps.py"
478 $ cat hg.pid >> $DAEMON_PIDS
398 $ cat hg.pid >> $DAEMON_PIDS
479
399
480 clone while modifying the repo between stating file with write lock and
400 clone while modifying the repo between stating file with write lock and
481 actually serving file content
401 actually serving file content
482
402
483 $ (hg clone -q --stream -U http://localhost:$HGPORT1 clone; touch "$HG_TEST_STREAM_WALKED_FILE_3") &
403 $ (hg clone -q --stream -U http://localhost:$HGPORT1 clone; touch "$HG_TEST_STREAM_WALKED_FILE_3") &
484 $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_1
404 $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_1
485 $ echo >> repo/f1
405 $ echo >> repo/f1
486 $ echo >> repo/f2
406 $ echo >> repo/f2
487 $ hg -R repo ci -m "1" --config ui.timeout.warn=-1
407 $ hg -R repo ci -m "1" --config ui.timeout.warn=-1
488 $ touch $HG_TEST_STREAM_WALKED_FILE_2
408 $ touch $HG_TEST_STREAM_WALKED_FILE_2
489 $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_3
409 $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_3
490 $ hg -R clone id
410 $ hg -R clone id
491 000000000000
411 000000000000
492 $ cat errors.log
412 $ cat errors.log
493 $ cd ..
413 $ cd ..
494
414
495 Stream repository with bookmarks
415 Stream repository with bookmarks
496 --------------------------------
416 --------------------------------
497
417
498 (revert introduction of secret changeset)
418 (revert introduction of secret changeset)
499
419
500 $ hg -R server phase --draft 'secret()'
420 $ hg -R server phase --draft 'secret()'
501
421
502 add a bookmark
422 add a bookmark
503
423
504 $ hg -R server bookmark -r tip some-bookmark
424 $ hg -R server bookmark -r tip some-bookmark
505
425
506 clone it
426 clone it
507
427
508 #if stream-legacy
428 #if stream-legacy
509 $ hg clone --stream http://localhost:$HGPORT with-bookmarks
429 $ hg clone --stream http://localhost:$HGPORT with-bookmarks
510 streaming all changes
430 streaming all changes
511 1091 files to transfer, 102 KB of data (no-zstd !)
431 1091 files to transfer, 102 KB of data (no-zstd !)
512 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
432 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
513 1091 files to transfer, 98.8 KB of data (zstd !)
433 1091 files to transfer, 98.8 KB of data (zstd !)
514 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
434 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
515 searching for changes
435 searching for changes
516 no changes found
436 no changes found
517 updating to branch default
437 updating to branch default
518 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
438 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
519 #endif
439 #endif
520 #if stream-bundle2-v2
440 #if stream-bundle2-v2
521 $ hg clone --stream http://localhost:$HGPORT with-bookmarks
441 $ hg clone --stream http://localhost:$HGPORT with-bookmarks
522 streaming all changes
442 streaming all changes
523 1097 files to transfer, 102 KB of data (no-zstd !)
443 1097 files to transfer, 102 KB of data (no-zstd !)
524 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
444 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
525 1097 files to transfer, 99.1 KB of data (zstd no-rust !)
445 1097 files to transfer, 99.1 KB of data (zstd no-rust !)
526 transferred 99.1 KB in * seconds (* */sec) (glob) (zstd no-rust !)
446 transferred 99.1 KB in * seconds (* */sec) (glob) (zstd no-rust !)
527 1099 files to transfer, 99.2 KB of data (zstd rust !)
447 1099 files to transfer, 99.2 KB of data (zstd rust !)
528 transferred 99.2 KB in * seconds (* */sec) (glob) (zstd rust !)
448 transferred 99.2 KB in * seconds (* */sec) (glob) (zstd rust !)
529 updating to branch default
449 updating to branch default
530 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
450 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
531 #endif
451 #endif
532 #if stream-bundle2-v3
452 #if stream-bundle2-v3
533 $ hg clone --stream http://localhost:$HGPORT with-bookmarks
453 $ hg clone --stream http://localhost:$HGPORT with-bookmarks
534 streaming all changes
454 streaming all changes
535 1096 entries to transfer
455 1096 entries to transfer
536 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
456 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
537 transferred 99.1 KB in * seconds (* */sec) (glob) (zstd no-rust !)
457 transferred 99.1 KB in * seconds (* */sec) (glob) (zstd no-rust !)
538 transferred 99.2 KB in * seconds (* */sec) (glob) (zstd rust !)
458 transferred 99.2 KB in * seconds (* */sec) (glob) (zstd rust !)
539 updating to branch default
459 updating to branch default
540 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
460 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
541 #endif
461 #endif
542 $ hg verify -R with-bookmarks -q
462 $ hg verify -R with-bookmarks -q
543 $ hg -R with-bookmarks bookmarks
463 $ hg -R with-bookmarks bookmarks
544 some-bookmark 2:5223b5e3265f
464 some-bookmark 2:5223b5e3265f
545
465
546 Stream repository with phases
466 Stream repository with phases
547 -----------------------------
467 -----------------------------
548
468
549 Clone as publishing
469 Clone as publishing
550
470
551 $ hg -R server phase -r 'all()'
471 $ hg -R server phase -r 'all()'
552 0: draft
472 0: draft
553 1: draft
473 1: draft
554 2: draft
474 2: draft
555
475
556 #if stream-legacy
476 #if stream-legacy
557 $ hg clone --stream http://localhost:$HGPORT phase-publish
477 $ hg clone --stream http://localhost:$HGPORT phase-publish
558 streaming all changes
478 streaming all changes
559 1091 files to transfer, 102 KB of data (no-zstd !)
479 1091 files to transfer, 102 KB of data (no-zstd !)
560 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
480 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
561 1091 files to transfer, 98.8 KB of data (zstd !)
481 1091 files to transfer, 98.8 KB of data (zstd !)
562 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
482 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
563 searching for changes
483 searching for changes
564 no changes found
484 no changes found
565 updating to branch default
485 updating to branch default
566 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
486 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
567 #endif
487 #endif
568 #if stream-bundle2-v2
488 #if stream-bundle2-v2
569 $ hg clone --stream http://localhost:$HGPORT phase-publish
489 $ hg clone --stream http://localhost:$HGPORT phase-publish
570 streaming all changes
490 streaming all changes
571 1097 files to transfer, 102 KB of data (no-zstd !)
491 1097 files to transfer, 102 KB of data (no-zstd !)
572 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
492 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
573 1097 files to transfer, 99.1 KB of data (zstd no-rust !)
493 1097 files to transfer, 99.1 KB of data (zstd no-rust !)
574 transferred 99.1 KB in * seconds (* */sec) (glob) (zstd no-rust !)
494 transferred 99.1 KB in * seconds (* */sec) (glob) (zstd no-rust !)
575 1099 files to transfer, 99.2 KB of data (zstd rust !)
495 1099 files to transfer, 99.2 KB of data (zstd rust !)
576 transferred 99.2 KB in * seconds (* */sec) (glob) (zstd rust !)
496 transferred 99.2 KB in * seconds (* */sec) (glob) (zstd rust !)
577 updating to branch default
497 updating to branch default
578 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
498 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
579 #endif
499 #endif
580 #if stream-bundle2-v3
500 #if stream-bundle2-v3
581 $ hg clone --stream http://localhost:$HGPORT phase-publish
501 $ hg clone --stream http://localhost:$HGPORT phase-publish
582 streaming all changes
502 streaming all changes
583 1096 entries to transfer
503 1096 entries to transfer
584 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
504 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
585 transferred 99.1 KB in * seconds (* */sec) (glob) (zstd no-rust !)
505 transferred 99.1 KB in * seconds (* */sec) (glob) (zstd no-rust !)
586 transferred 99.2 KB in * seconds (* */sec) (glob) (zstd rust !)
506 transferred 99.2 KB in * seconds (* */sec) (glob) (zstd rust !)
587 updating to branch default
507 updating to branch default
588 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
508 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
589 #endif
509 #endif
590 $ hg verify -R phase-publish -q
510 $ hg verify -R phase-publish -q
591 $ hg -R phase-publish phase -r 'all()'
511 $ hg -R phase-publish phase -r 'all()'
592 0: public
512 0: public
593 1: public
513 1: public
594 2: public
514 2: public
595
515
596 Clone as non publishing
516 Clone as non publishing
597
517
598 $ cat << EOF >> server/.hg/hgrc
518 $ cat << EOF >> server/.hg/hgrc
599 > [phases]
519 > [phases]
600 > publish = False
520 > publish = False
601 > EOF
521 > EOF
602 $ killdaemons.py
522 $ killdaemons.py
603 $ hg -R server serve -p $HGPORT -d --pid-file=hg.pid
523 $ hg -R server serve -p $HGPORT -d --pid-file=hg.pid
604 $ cat hg.pid > $DAEMON_PIDS
524 $ cat hg.pid > $DAEMON_PIDS
605
525
606 #if stream-legacy
526 #if stream-legacy
607
527
608 With v1 of the stream protocol, changeset are always cloned as public. It make
528 With v1 of the stream protocol, changeset are always cloned as public. It make
609 stream v1 unsuitable for non-publishing repository.
529 stream v1 unsuitable for non-publishing repository.
610
530
611 $ hg clone --stream http://localhost:$HGPORT phase-no-publish
531 $ hg clone --stream http://localhost:$HGPORT phase-no-publish
612 streaming all changes
532 streaming all changes
613 1091 files to transfer, 102 KB of data (no-zstd !)
533 1091 files to transfer, 102 KB of data (no-zstd !)
614 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
534 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
615 1091 files to transfer, 98.8 KB of data (zstd !)
535 1091 files to transfer, 98.8 KB of data (zstd !)
616 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
536 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
617 searching for changes
537 searching for changes
618 no changes found
538 no changes found
619 updating to branch default
539 updating to branch default
620 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
540 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
621 $ hg -R phase-no-publish phase -r 'all()'
541 $ hg -R phase-no-publish phase -r 'all()'
622 0: public
542 0: public
623 1: public
543 1: public
624 2: public
544 2: public
625 #endif
545 #endif
626 #if stream-bundle2-v2
546 #if stream-bundle2-v2
627 $ hg clone --stream http://localhost:$HGPORT phase-no-publish
547 $ hg clone --stream http://localhost:$HGPORT phase-no-publish
628 streaming all changes
548 streaming all changes
629 1098 files to transfer, 102 KB of data (no-zstd !)
549 1098 files to transfer, 102 KB of data (no-zstd !)
630 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
550 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
631 1098 files to transfer, 99.1 KB of data (zstd no-rust !)
551 1098 files to transfer, 99.1 KB of data (zstd no-rust !)
632 transferred 99.1 KB in * seconds (* */sec) (glob) (zstd no-rust !)
552 transferred 99.1 KB in * seconds (* */sec) (glob) (zstd no-rust !)
633 1100 files to transfer, 99.2 KB of data (zstd rust !)
553 1100 files to transfer, 99.2 KB of data (zstd rust !)
634 transferred 99.2 KB in * seconds (* */sec) (glob) (zstd rust !)
554 transferred 99.2 KB in * seconds (* */sec) (glob) (zstd rust !)
635 updating to branch default
555 updating to branch default
636 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
556 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
637 $ hg -R phase-no-publish phase -r 'all()'
557 $ hg -R phase-no-publish phase -r 'all()'
638 0: draft
558 0: draft
639 1: draft
559 1: draft
640 2: draft
560 2: draft
641 #endif
561 #endif
642 #if stream-bundle2-v3
562 #if stream-bundle2-v3
643 $ hg clone --stream http://localhost:$HGPORT phase-no-publish
563 $ hg clone --stream http://localhost:$HGPORT phase-no-publish
644 streaming all changes
564 streaming all changes
645 1097 entries to transfer
565 1097 entries to transfer
646 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
566 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
647 transferred 99.1 KB in * seconds (* */sec) (glob) (zstd no-rust !)
567 transferred 99.1 KB in * seconds (* */sec) (glob) (zstd no-rust !)
648 transferred 99.2 KB in * seconds (* */sec) (glob) (zstd rust !)
568 transferred 99.2 KB in * seconds (* */sec) (glob) (zstd rust !)
649 updating to branch default
569 updating to branch default
650 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
570 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
651 $ hg -R phase-no-publish phase -r 'all()'
571 $ hg -R phase-no-publish phase -r 'all()'
652 0: draft
572 0: draft
653 1: draft
573 1: draft
654 2: draft
574 2: draft
655 #endif
575 #endif
656 $ hg verify -R phase-no-publish -q
576 $ hg verify -R phase-no-publish -q
657
577
658 $ killdaemons.py
578 $ killdaemons.py
659
579
660 #if stream-legacy
580 #if stream-legacy
661
581
662 With v1 of the stream protocol, changeset are always cloned as public. There's
582 With v1 of the stream protocol, changeset are always cloned as public. There's
663 no obsolescence markers exchange in stream v1.
583 no obsolescence markers exchange in stream v1.
664
584
665 #endif
585 #endif
666 #if stream-bundle2-v2
586 #if stream-bundle2-v2
667
587
668 Stream repository with obsolescence
588 Stream repository with obsolescence
669 -----------------------------------
589 -----------------------------------
670
590
671 Clone non-publishing with obsolescence
591 Clone non-publishing with obsolescence
672
592
673 $ cat >> $HGRCPATH << EOF
593 $ cat >> $HGRCPATH << EOF
674 > [experimental]
594 > [experimental]
675 > evolution=all
595 > evolution=all
676 > EOF
596 > EOF
677
597
678 $ cd server
598 $ cd server
679 $ echo foo > foo
599 $ echo foo > foo
680 $ hg -q commit -m 'about to be pruned'
600 $ hg -q commit -m 'about to be pruned'
681 $ hg debugobsolete `hg log -r . -T '{node}'` -d '0 0' -u test --record-parents
601 $ hg debugobsolete `hg log -r . -T '{node}'` -d '0 0' -u test --record-parents
682 1 new obsolescence markers
602 1 new obsolescence markers
683 obsoleted 1 changesets
603 obsoleted 1 changesets
684 $ hg up null -q
604 $ hg up null -q
685 $ hg log -T '{rev}: {phase}\n'
605 $ hg log -T '{rev}: {phase}\n'
686 2: draft
606 2: draft
687 1: draft
607 1: draft
688 0: draft
608 0: draft
689 $ hg serve -p $HGPORT -d --pid-file=hg.pid
609 $ hg serve -p $HGPORT -d --pid-file=hg.pid
690 $ cat hg.pid > $DAEMON_PIDS
610 $ cat hg.pid > $DAEMON_PIDS
691 $ cd ..
611 $ cd ..
692
612
693 $ hg clone -U --stream http://localhost:$HGPORT with-obsolescence
613 $ hg clone -U --stream http://localhost:$HGPORT with-obsolescence
694 streaming all changes
614 streaming all changes
695 1099 files to transfer, 102 KB of data (no-zstd !)
615 1099 files to transfer, 102 KB of data (no-zstd !)
696 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
616 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
697 1099 files to transfer, 99.5 KB of data (zstd no-rust !)
617 1099 files to transfer, 99.5 KB of data (zstd no-rust !)
698 transferred 99.5 KB in * seconds (* */sec) (glob) (zstd no-rust !)
618 transferred 99.5 KB in * seconds (* */sec) (glob) (zstd no-rust !)
699 1101 files to transfer, 99.6 KB of data (zstd rust !)
619 1101 files to transfer, 99.6 KB of data (zstd rust !)
700 transferred 99.6 KB in * seconds (* */sec) (glob) (zstd rust !)
620 transferred 99.6 KB in * seconds (* */sec) (glob) (zstd rust !)
701 $ hg -R with-obsolescence log -T '{rev}: {phase}\n'
621 $ hg -R with-obsolescence log -T '{rev}: {phase}\n'
702 2: draft
622 2: draft
703 1: draft
623 1: draft
704 0: draft
624 0: draft
705 $ hg debugobsolete -R with-obsolescence
625 $ hg debugobsolete -R with-obsolescence
706 8c206a663911c1f97f2f9d7382e417ae55872cfa 0 {5223b5e3265f0df40bb743da62249413d74ac70f} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
626 8c206a663911c1f97f2f9d7382e417ae55872cfa 0 {5223b5e3265f0df40bb743da62249413d74ac70f} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
707 $ hg verify -R with-obsolescence -q
627 $ hg verify -R with-obsolescence -q
708
628
709 $ hg clone -U --stream --config experimental.evolution=0 http://localhost:$HGPORT with-obsolescence-no-evolution
629 $ hg clone -U --stream --config experimental.evolution=0 http://localhost:$HGPORT with-obsolescence-no-evolution
710 streaming all changes
630 streaming all changes
711 remote: abort: server has obsolescence markers, but client cannot receive them via stream clone
631 remote: abort: server has obsolescence markers, but client cannot receive them via stream clone
712 abort: pull failed on remote
632 abort: pull failed on remote
713 [100]
633 [100]
714
634
715 $ killdaemons.py
635 $ killdaemons.py
716
636
717 #endif
637 #endif
718 #if stream-bundle2-v3
638 #if stream-bundle2-v3
719
639
720 Stream repository with obsolescence
640 Stream repository with obsolescence
721 -----------------------------------
641 -----------------------------------
722
642
723 Clone non-publishing with obsolescence
643 Clone non-publishing with obsolescence
724
644
725 $ cat >> $HGRCPATH << EOF
645 $ cat >> $HGRCPATH << EOF
726 > [experimental]
646 > [experimental]
727 > evolution=all
647 > evolution=all
728 > EOF
648 > EOF
729
649
730 $ cd server
650 $ cd server
731 $ echo foo > foo
651 $ echo foo > foo
732 $ hg -q commit -m 'about to be pruned'
652 $ hg -q commit -m 'about to be pruned'
733 $ hg debugobsolete `hg log -r . -T '{node}'` -d '0 0' -u test --record-parents
653 $ hg debugobsolete `hg log -r . -T '{node}'` -d '0 0' -u test --record-parents
734 1 new obsolescence markers
654 1 new obsolescence markers
735 obsoleted 1 changesets
655 obsoleted 1 changesets
736 $ hg up null -q
656 $ hg up null -q
737 $ hg log -T '{rev}: {phase}\n'
657 $ hg log -T '{rev}: {phase}\n'
738 2: draft
658 2: draft
739 1: draft
659 1: draft
740 0: draft
660 0: draft
741 $ hg serve -p $HGPORT -d --pid-file=hg.pid
661 $ hg serve -p $HGPORT -d --pid-file=hg.pid
742 $ cat hg.pid > $DAEMON_PIDS
662 $ cat hg.pid > $DAEMON_PIDS
743 $ cd ..
663 $ cd ..
744
664
745 $ hg clone -U --stream http://localhost:$HGPORT with-obsolescence
665 $ hg clone -U --stream http://localhost:$HGPORT with-obsolescence
746 streaming all changes
666 streaming all changes
747 1098 entries to transfer
667 1098 entries to transfer
748 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
668 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
749 transferred 99.5 KB in * seconds (* */sec) (glob) (zstd no-rust !)
669 transferred 99.5 KB in * seconds (* */sec) (glob) (zstd no-rust !)
750 transferred 99.6 KB in * seconds (* */sec) (glob) (zstd rust !)
670 transferred 99.6 KB in * seconds (* */sec) (glob) (zstd rust !)
751 $ hg -R with-obsolescence log -T '{rev}: {phase}\n'
671 $ hg -R with-obsolescence log -T '{rev}: {phase}\n'
752 2: draft
672 2: draft
753 1: draft
673 1: draft
754 0: draft
674 0: draft
755 $ hg debugobsolete -R with-obsolescence
675 $ hg debugobsolete -R with-obsolescence
756 8c206a663911c1f97f2f9d7382e417ae55872cfa 0 {5223b5e3265f0df40bb743da62249413d74ac70f} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
676 8c206a663911c1f97f2f9d7382e417ae55872cfa 0 {5223b5e3265f0df40bb743da62249413d74ac70f} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
757 $ hg verify -R with-obsolescence -q
677 $ hg verify -R with-obsolescence -q
758
678
759 $ hg clone -U --stream --config experimental.evolution=0 http://localhost:$HGPORT with-obsolescence-no-evolution
679 $ hg clone -U --stream --config experimental.evolution=0 http://localhost:$HGPORT with-obsolescence-no-evolution
760 streaming all changes
680 streaming all changes
761 remote: abort: server has obsolescence markers, but client cannot receive them via stream clone
681 remote: abort: server has obsolescence markers, but client cannot receive them via stream clone
762 abort: pull failed on remote
682 abort: pull failed on remote
763 [100]
683 [100]
764
684
765 $ killdaemons.py
685 $ killdaemons.py
766
686
767 #endif
687 #endif
768
688
769 Cloning a repo with no requirements doesn't give some obscure error
689 Cloning a repo with no requirements doesn't give some obscure error
770
690
771 $ mkdir -p empty-repo/.hg
691 $ mkdir -p empty-repo/.hg
772 $ hg clone -q --stream ssh://user@dummy/empty-repo empty-repo2
692 $ hg clone -q --stream ssh://user@dummy/empty-repo empty-repo2
773 $ hg --cwd empty-repo2 verify -q
693 $ hg --cwd empty-repo2 verify -q
774
694
775 Cloning a repo with an empty manifestlog doesn't give some weird error
695 Cloning a repo with an empty manifestlog doesn't give some weird error
776
696
777 $ rm -r empty-repo; hg init empty-repo
697 $ rm -r empty-repo; hg init empty-repo
778 $ (cd empty-repo; touch x; hg commit -Am empty; hg debugstrip -r 0) > /dev/null
698 $ (cd empty-repo; touch x; hg commit -Am empty; hg debugstrip -r 0) > /dev/null
779 $ hg clone -q --stream ssh://user@dummy/empty-repo empty-repo3
699 $ hg clone -q --stream ssh://user@dummy/empty-repo empty-repo3
780 $ hg --cwd empty-repo3 verify -q 2>&1 | grep -v warning
700 $ hg --cwd empty-repo3 verify -q 2>&1 | grep -v warning
781 [1]
701 [1]
782
702
783 The warnings filtered out here are talking about zero-length 'orphan' data files.
703 The warnings filtered out here are talking about zero-length 'orphan' data files.
784 Those are harmless, so that's fine.
704 Those are harmless, so that's fine.
785
705
General Comments 0
You need to be logged in to leave comments. Login now