Show More
@@ -1,370 +1,370 | |||
|
1 | 1 | $ PYTHONPATH=$TESTDIR/..:$PYTHONPATH |
|
2 | 2 | $ export PYTHONPATH |
|
3 | 3 | |
|
4 | 4 | $ . "$TESTDIR/remotefilelog-library.sh" |
|
5 | 5 | |
|
6 | 6 | $ hginit master |
|
7 | 7 | $ cd master |
|
8 | 8 | $ cat >> .hg/hgrc <<EOF |
|
9 | 9 | > [remotefilelog] |
|
10 | 10 | > server=True |
|
11 | 11 | > EOF |
|
12 | 12 | $ echo x > x |
|
13 | 13 | $ echo z > z |
|
14 | 14 | $ hg commit -qAm x |
|
15 | 15 | $ echo x2 > x |
|
16 | 16 | $ echo y > y |
|
17 | 17 | $ hg commit -qAm y |
|
18 | 18 | $ echo w > w |
|
19 | 19 | $ rm z |
|
20 | 20 | $ hg commit -qAm w |
|
21 | 21 | $ hg bookmark foo |
|
22 | 22 | |
|
23 | 23 | $ cd .. |
|
24 | 24 | |
|
25 | 25 | # clone the repo |
|
26 | 26 | |
|
27 | 27 | $ hgcloneshallow ssh://user@dummy/master shallow --noupdate |
|
28 | 28 | streaming all changes |
|
29 | 29 | 2 files to transfer, 776 bytes of data |
|
30 | 30 | transferred 776 bytes in * seconds (*/sec) (glob) |
|
31 | 31 | searching for changes |
|
32 | 32 | no changes found |
|
33 | 33 | |
|
34 | 34 | # Set the prefetchdays config to zero so that all commits are prefetched |
|
35 | 35 | # no matter what their creation date is. Also set prefetchdelay config |
|
36 | 36 | # to zero so that there is no delay between prefetches. |
|
37 | 37 | $ cd shallow |
|
38 | 38 | $ cat >> .hg/hgrc <<EOF |
|
39 | 39 | > [remotefilelog] |
|
40 | 40 | > prefetchdays=0 |
|
41 | 41 | > prefetchdelay=0 |
|
42 | 42 | > EOF |
|
43 | 43 | $ cd .. |
|
44 | 44 | |
|
45 | 45 | # prefetch a revision |
|
46 | 46 | $ cd shallow |
|
47 | 47 | |
|
48 | 48 | $ hg prefetch -r 0 |
|
49 | 49 | 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob) |
|
50 | 50 | |
|
51 | 51 | $ hg cat -r 0 x |
|
52 | 52 | x |
|
53 | 53 | |
|
54 | 54 | # background prefetch on pull when configured |
|
55 | 55 | |
|
56 | 56 | $ cat >> .hg/hgrc <<EOF |
|
57 | 57 | > [remotefilelog] |
|
58 | 58 | > pullprefetch=bookmark() |
|
59 | 59 | > backgroundprefetch=True |
|
60 | 60 | > EOF |
|
61 | 61 | $ hg strip tip |
|
62 | 62 | saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/6b4b6f66ef8c-b4b8bdaf-backup.hg (glob) |
|
63 | 63 | |
|
64 | 64 | $ clearcache |
|
65 | 65 | $ hg pull |
|
66 | 66 | pulling from ssh://user@dummy/master |
|
67 | 67 | searching for changes |
|
68 | 68 | adding changesets |
|
69 | 69 | adding manifests |
|
70 | 70 | adding file changes |
|
71 | 71 | added 1 changesets with 0 changes to 0 files |
|
72 | 72 | updating bookmark foo |
|
73 | 73 | new changesets 6b4b6f66ef8c |
|
74 | 74 | (run 'hg update' to get a working copy) |
|
75 | 75 | prefetching file contents |
|
76 | 76 | $ sleep 0.5 |
|
77 | 77 | $ hg debugwaitonprefetch >/dev/null 2>%1 |
|
78 | 78 | $ find $CACHEDIR -type f | sort |
|
79 | 79 | $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/ef95c5376f34698742fe34f315fd82136f8f68c0 |
|
80 | 80 | $TESTTMP/hgcache/master/95/cb0bfd2977c761298d9624e4b4d4c72a39974a/076f5e2225b3ff0400b98c92aa6cdf403ee24cca |
|
81 | 81 | $TESTTMP/hgcache/master/af/f024fe4ab0fece4091de044c58c9ae4233383a/bb6ccd5dceaa5e9dc220e0dad65e051b94f69a2c |
|
82 | 82 | $TESTTMP/hgcache/repos |
|
83 | 83 | |
|
84 | 84 | # background prefetch with repack on pull when configured |
|
85 | 85 | |
|
86 | 86 | $ cat >> .hg/hgrc <<EOF |
|
87 | 87 | > [remotefilelog] |
|
88 | 88 | > backgroundrepack=True |
|
89 | 89 | > EOF |
|
90 | 90 | $ hg strip tip |
|
91 | 91 | saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/6b4b6f66ef8c-b4b8bdaf-backup.hg (glob) |
|
92 | 92 | |
|
93 | 93 | $ clearcache |
|
94 | 94 | $ hg pull |
|
95 | 95 | pulling from ssh://user@dummy/master |
|
96 | 96 | searching for changes |
|
97 | 97 | adding changesets |
|
98 | 98 | adding manifests |
|
99 | 99 | adding file changes |
|
100 | 100 | added 1 changesets with 0 changes to 0 files |
|
101 | 101 | updating bookmark foo |
|
102 | 102 | new changesets 6b4b6f66ef8c |
|
103 | 103 | (run 'hg update' to get a working copy) |
|
104 | 104 | prefetching file contents |
|
105 | 105 | $ sleep 0.5 |
|
106 | 106 | $ hg debugwaitonprefetch >/dev/null 2>%1 |
|
107 | 107 | $ sleep 0.5 |
|
108 | 108 | $ hg debugwaitonrepack >/dev/null 2>%1 |
|
109 | 109 | $ find $CACHEDIR -type f | sort |
|
110 | 110 | $TESTTMP/hgcache/master/packs/94d53eef9e622533aec1fc6d8053cb086e785d21.histidx |
|
111 | 111 | $TESTTMP/hgcache/master/packs/94d53eef9e622533aec1fc6d8053cb086e785d21.histpack |
|
112 | 112 | $TESTTMP/hgcache/master/packs/f3644bc7773e8289deda7f765138120c838f4e6e.dataidx |
|
113 | 113 | $TESTTMP/hgcache/master/packs/f3644bc7773e8289deda7f765138120c838f4e6e.datapack |
|
114 | 114 | $TESTTMP/hgcache/master/packs/repacklock |
|
115 | 115 | $TESTTMP/hgcache/repos |
|
116 | 116 | |
|
117 | 117 | # background prefetch with repack on update when wcprevset configured |
|
118 | 118 | |
|
119 | 119 | $ clearcache |
|
120 | 120 | $ hg up -r 0 |
|
121 | 121 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
122 | 122 | 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob) |
|
123 | 123 | $ find $CACHEDIR -type f | sort |
|
124 | 124 | $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1406e74118627694268417491f018a4a883152f0 |
|
125 | 125 | $TESTTMP/hgcache/master/39/5df8f7c51f007019cb30201c49e884b46b92fa/69a1b67522704ec122181c0890bd16e9d3e7516a |
|
126 | 126 | $TESTTMP/hgcache/repos |
|
127 | 127 | |
|
128 | 128 | $ hg up -r 1 |
|
129 | 129 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
130 | 130 | 2 files fetched over 2 fetches - (2 misses, 0.00% hit ratio) over *s (glob) |
|
131 | 131 | |
|
132 | 132 | $ cat >> .hg/hgrc <<EOF |
|
133 | 133 | > [remotefilelog] |
|
134 | 134 | > bgprefetchrevs=.:: |
|
135 | 135 | > EOF |
|
136 | 136 | |
|
137 | 137 | $ clearcache |
|
138 | 138 | $ hg up -r 0 |
|
139 | 139 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
140 | 140 | * files fetched over * fetches - (* misses, 0.00% hit ratio) over *s (glob) |
|
141 | 141 | $ sleep 1 |
|
142 | 142 | $ hg debugwaitonprefetch >/dev/null 2>%1 |
|
143 | 143 | $ sleep 1 |
|
144 | 144 | $ hg debugwaitonrepack >/dev/null 2>%1 |
|
145 | 145 | $ find $CACHEDIR -type f | sort |
|
146 | 146 | $TESTTMP/hgcache/master/packs/27c52c105a1ddf8c75143a6b279b04c24b1f4bee.histidx |
|
147 | 147 | $TESTTMP/hgcache/master/packs/27c52c105a1ddf8c75143a6b279b04c24b1f4bee.histpack |
|
148 | 148 | $TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.dataidx |
|
149 | 149 | $TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.datapack |
|
150 | 150 | $TESTTMP/hgcache/master/packs/repacklock |
|
151 | 151 | $TESTTMP/hgcache/repos |
|
152 | 152 | |
|
153 | 153 | # Ensure that file 'w' was prefetched - it was not part of the update operation and therefore |
|
154 | 154 | # could only be downloaded by the background prefetch |
|
155 | 155 | |
|
156 |
$ hg debugdatapack $TESTTMP/hgcache/master/packs/ |
|
|
156 | $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1` | |
|
157 | 157 | $TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0: |
|
158 | 158 | w: |
|
159 | 159 | Node Delta Base Delta Length Blob Size |
|
160 | 160 | bb6ccd5dceaa 000000000000 2 2 |
|
161 | 161 | |
|
162 | 162 | Total: 2 2 (0.0% bigger) |
|
163 | 163 | x: |
|
164 | 164 | Node Delta Base Delta Length Blob Size |
|
165 | 165 | ef95c5376f34 000000000000 3 3 |
|
166 | 166 | 1406e7411862 ef95c5376f34 14 2 |
|
167 | 167 | |
|
168 | 168 | Total: 17 5 (240.0% bigger) |
|
169 | 169 | y: |
|
170 | 170 | Node Delta Base Delta Length Blob Size |
|
171 | 171 | 076f5e2225b3 000000000000 2 2 |
|
172 | 172 | |
|
173 | 173 | Total: 2 2 (0.0% bigger) |
|
174 | 174 | z: |
|
175 | 175 | Node Delta Base Delta Length Blob Size |
|
176 | 176 | 69a1b6752270 000000000000 2 2 |
|
177 | 177 | |
|
178 | 178 | Total: 2 2 (0.0% bigger) |
|
179 | 179 | |
|
180 | 180 | # background prefetch with repack on commit when wcprevset configured |
|
181 | 181 | |
|
182 | 182 | $ cat >> .hg/hgrc <<EOF |
|
183 | 183 | > [remotefilelog] |
|
184 | 184 | > bgprefetchrevs=0:: |
|
185 | 185 | > EOF |
|
186 | 186 | |
|
187 | 187 | $ clearcache |
|
188 | 188 | $ find $CACHEDIR -type f | sort |
|
189 | 189 | $ echo b > b |
|
190 | 190 | $ hg commit -qAm b |
|
191 | 191 | * files fetched over 1 fetches - (* misses, 0.00% hit ratio) over *s (glob) |
|
192 | 192 | $ hg bookmark temporary |
|
193 | 193 | $ sleep 1 |
|
194 | 194 | $ hg debugwaitonprefetch >/dev/null 2>%1 |
|
195 | 195 | $ sleep 1 |
|
196 | 196 | $ hg debugwaitonrepack >/dev/null 2>%1 |
|
197 | 197 | $ find $CACHEDIR -type f | sort |
|
198 | 198 | $TESTTMP/hgcache/master/packs/27c52c105a1ddf8c75143a6b279b04c24b1f4bee.histidx |
|
199 | 199 | $TESTTMP/hgcache/master/packs/27c52c105a1ddf8c75143a6b279b04c24b1f4bee.histpack |
|
200 | 200 | $TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.dataidx |
|
201 | 201 | $TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.datapack |
|
202 | 202 | $TESTTMP/hgcache/master/packs/repacklock |
|
203 | 203 | $TESTTMP/hgcache/repos |
|
204 | 204 | |
|
205 | 205 | # Ensure that file 'w' was prefetched - it was not part of the commit operation and therefore |
|
206 | 206 | # could only be downloaded by the background prefetch |
|
207 | 207 | |
|
208 |
$ hg debugdatapack $TESTTMP/hgcache/master/packs/ |
|
|
208 | $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1` | |
|
209 | 209 | $TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0: |
|
210 | 210 | w: |
|
211 | 211 | Node Delta Base Delta Length Blob Size |
|
212 | 212 | bb6ccd5dceaa 000000000000 2 2 |
|
213 | 213 | |
|
214 | 214 | Total: 2 2 (0.0% bigger) |
|
215 | 215 | x: |
|
216 | 216 | Node Delta Base Delta Length Blob Size |
|
217 | 217 | ef95c5376f34 000000000000 3 3 |
|
218 | 218 | 1406e7411862 ef95c5376f34 14 2 |
|
219 | 219 | |
|
220 | 220 | Total: 17 5 (240.0% bigger) |
|
221 | 221 | y: |
|
222 | 222 | Node Delta Base Delta Length Blob Size |
|
223 | 223 | 076f5e2225b3 000000000000 2 2 |
|
224 | 224 | |
|
225 | 225 | Total: 2 2 (0.0% bigger) |
|
226 | 226 | z: |
|
227 | 227 | Node Delta Base Delta Length Blob Size |
|
228 | 228 | 69a1b6752270 000000000000 2 2 |
|
229 | 229 | |
|
230 | 230 | Total: 2 2 (0.0% bigger) |
|
231 | 231 | |
|
232 | 232 | # background prefetch with repack on rebase when wcprevset configured |
|
233 | 233 | |
|
234 | 234 | $ hg up -r 2 |
|
235 | 235 | 3 files updated, 0 files merged, 3 files removed, 0 files unresolved |
|
236 | 236 | (leaving bookmark temporary) |
|
237 | 237 | $ clearcache |
|
238 | 238 | $ find $CACHEDIR -type f | sort |
|
239 | 239 | $ hg rebase -s temporary -d foo |
|
240 | 240 | rebasing 3:58147a5b5242 "b" (temporary tip) |
|
241 | 241 | saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/58147a5b5242-c3678817-rebase.hg (glob) |
|
242 | 242 | 3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over *s (glob) |
|
243 | 243 | $ sleep 1 |
|
244 | 244 | $ hg debugwaitonprefetch >/dev/null 2>%1 |
|
245 | 245 | $ sleep 1 |
|
246 | 246 | $ hg debugwaitonrepack >/dev/null 2>%1 |
|
247 | 247 | |
|
248 | 248 | # Ensure that file 'y' was prefetched - it was not part of the rebase operation and therefore |
|
249 | 249 | # could only be downloaded by the background prefetch |
|
250 | 250 | |
|
251 |
$ hg debugdatapack $TESTTMP/hgcache/master/packs/ |
|
|
251 | $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1` | |
|
252 | 252 | $TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0: |
|
253 | 253 | w: |
|
254 | 254 | Node Delta Base Delta Length Blob Size |
|
255 | 255 | bb6ccd5dceaa 000000000000 2 2 |
|
256 | 256 | |
|
257 | 257 | Total: 2 2 (0.0% bigger) |
|
258 | 258 | x: |
|
259 | 259 | Node Delta Base Delta Length Blob Size |
|
260 | 260 | ef95c5376f34 000000000000 3 3 |
|
261 | 261 | 1406e7411862 ef95c5376f34 14 2 |
|
262 | 262 | |
|
263 | 263 | Total: 17 5 (240.0% bigger) |
|
264 | 264 | y: |
|
265 | 265 | Node Delta Base Delta Length Blob Size |
|
266 | 266 | 076f5e2225b3 000000000000 2 2 |
|
267 | 267 | |
|
268 | 268 | Total: 2 2 (0.0% bigger) |
|
269 | 269 | z: |
|
270 | 270 | Node Delta Base Delta Length Blob Size |
|
271 | 271 | 69a1b6752270 000000000000 2 2 |
|
272 | 272 | |
|
273 | 273 | Total: 2 2 (0.0% bigger) |
|
274 | 274 | |
|
275 | 275 | # Check that foregound prefetch with no arguments blocks until background prefetches finish |
|
276 | 276 | |
|
277 | 277 | $ hg up -r 3 |
|
278 | 278 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
279 | 279 | $ clearcache |
|
280 | 280 | $ hg prefetch --repack |
|
281 | 281 | waiting for lock on prefetching in $TESTTMP/shallow held by process * on host * (glob) (?) |
|
282 | 282 | got lock after * seconds (glob) (?) |
|
283 | 283 | (running background incremental repack) |
|
284 | 284 | * files fetched over 1 fetches - (* misses, 0.00% hit ratio) over *s (glob) (?) |
|
285 | 285 | |
|
286 | 286 | $ sleep 0.5 |
|
287 | 287 | $ hg debugwaitonrepack >/dev/null 2>%1 |
|
288 | 288 | |
|
289 | 289 | $ find $CACHEDIR -type f | sort |
|
290 | 290 | $TESTTMP/hgcache/master/packs/27c52c105a1ddf8c75143a6b279b04c24b1f4bee.histidx |
|
291 | 291 | $TESTTMP/hgcache/master/packs/27c52c105a1ddf8c75143a6b279b04c24b1f4bee.histpack |
|
292 | 292 | $TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.dataidx |
|
293 | 293 | $TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.datapack |
|
294 | 294 | $TESTTMP/hgcache/master/packs/repacklock |
|
295 | 295 | $TESTTMP/hgcache/repos |
|
296 | 296 | |
|
297 | 297 | # Ensure that files were prefetched |
|
298 |
$ hg debugdatapack $TESTTMP/hgcache/master/packs/ |
|
|
298 | $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1` | |
|
299 | 299 | $TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0: |
|
300 | 300 | w: |
|
301 | 301 | Node Delta Base Delta Length Blob Size |
|
302 | 302 | bb6ccd5dceaa 000000000000 2 2 |
|
303 | 303 | |
|
304 | 304 | Total: 2 2 (0.0% bigger) |
|
305 | 305 | x: |
|
306 | 306 | Node Delta Base Delta Length Blob Size |
|
307 | 307 | ef95c5376f34 000000000000 3 3 |
|
308 | 308 | 1406e7411862 ef95c5376f34 14 2 |
|
309 | 309 | |
|
310 | 310 | Total: 17 5 (240.0% bigger) |
|
311 | 311 | y: |
|
312 | 312 | Node Delta Base Delta Length Blob Size |
|
313 | 313 | 076f5e2225b3 000000000000 2 2 |
|
314 | 314 | |
|
315 | 315 | Total: 2 2 (0.0% bigger) |
|
316 | 316 | z: |
|
317 | 317 | Node Delta Base Delta Length Blob Size |
|
318 | 318 | 69a1b6752270 000000000000 2 2 |
|
319 | 319 | |
|
320 | 320 | Total: 2 2 (0.0% bigger) |
|
321 | 321 | |
|
322 | 322 | # Check that foreground prefetch fetches revs specified by '. + draft() + bgprefetchrevs + pullprefetch' |
|
323 | 323 | |
|
324 | 324 | $ clearcache |
|
325 | 325 | $ hg prefetch --repack |
|
326 | 326 | waiting for lock on prefetching in $TESTTMP/shallow held by process * on host * (glob) (?) |
|
327 | 327 | got lock after * seconds (glob) (?) |
|
328 | 328 | (running background incremental repack) |
|
329 | 329 | * files fetched over 1 fetches - (* misses, 0.00% hit ratio) over *s (glob) (?) |
|
330 | 330 | $ sleep 0.5 |
|
331 | 331 | $ hg debugwaitonrepack >/dev/null 2>%1 |
|
332 | 332 | |
|
333 | 333 | $ find $CACHEDIR -type f | sort |
|
334 | 334 | $TESTTMP/hgcache/master/packs/27c52c105a1ddf8c75143a6b279b04c24b1f4bee.histidx |
|
335 | 335 | $TESTTMP/hgcache/master/packs/27c52c105a1ddf8c75143a6b279b04c24b1f4bee.histpack |
|
336 | 336 | $TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.dataidx |
|
337 | 337 | $TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.datapack |
|
338 | 338 | $TESTTMP/hgcache/master/packs/repacklock |
|
339 | 339 | $TESTTMP/hgcache/repos |
|
340 | 340 | |
|
341 | 341 | # Ensure that files were prefetched |
|
342 |
$ hg debugdatapack $TESTTMP/hgcache/master/packs/ |
|
|
342 | $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1` | |
|
343 | 343 | $TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0: |
|
344 | 344 | w: |
|
345 | 345 | Node Delta Base Delta Length Blob Size |
|
346 | 346 | bb6ccd5dceaa 000000000000 2 2 |
|
347 | 347 | |
|
348 | 348 | Total: 2 2 (0.0% bigger) |
|
349 | 349 | x: |
|
350 | 350 | Node Delta Base Delta Length Blob Size |
|
351 | 351 | ef95c5376f34 000000000000 3 3 |
|
352 | 352 | 1406e7411862 ef95c5376f34 14 2 |
|
353 | 353 | |
|
354 | 354 | Total: 17 5 (240.0% bigger) |
|
355 | 355 | y: |
|
356 | 356 | Node Delta Base Delta Length Blob Size |
|
357 | 357 | 076f5e2225b3 000000000000 2 2 |
|
358 | 358 | |
|
359 | 359 | Total: 2 2 (0.0% bigger) |
|
360 | 360 | z: |
|
361 | 361 | Node Delta Base Delta Length Blob Size |
|
362 | 362 | 69a1b6752270 000000000000 2 2 |
|
363 | 363 | |
|
364 | 364 | Total: 2 2 (0.0% bigger) |
|
365 | 365 | |
|
366 | 366 | # Test that if data was prefetched and repacked we dont need to prefetch it again |
|
367 | 367 | # It ensures that Mercurial looks not only in loose files but in packs as well |
|
368 | 368 | |
|
369 | 369 | $ hg prefetch --repack |
|
370 | 370 | (running background incremental repack) |
@@ -1,160 +1,160 | |||
|
1 | 1 | $ PYTHONPATH=$TESTDIR/..:$PYTHONPATH |
|
2 | 2 | $ export PYTHONPATH |
|
3 | 3 | |
|
4 | 4 | $ . "$TESTDIR/remotefilelog-library.sh" |
|
5 | 5 | |
|
6 | 6 | $ hginit master |
|
7 | 7 | $ cd master |
|
8 | 8 | $ cat >> .hg/hgrc <<EOF |
|
9 | 9 | > [remotefilelog] |
|
10 | 10 | > server=True |
|
11 | 11 | > EOF |
|
12 | 12 | $ echo x > x |
|
13 | 13 | $ hg commit -qAm x |
|
14 | 14 | $ echo y > y |
|
15 | 15 | $ rm x |
|
16 | 16 | $ hg commit -qAm DxAy |
|
17 | 17 | $ echo yy > y |
|
18 | 18 | $ hg commit -qAm y |
|
19 | 19 | $ cd .. |
|
20 | 20 | |
|
21 | 21 | $ hgcloneshallow ssh://user@dummy/master shallow -q |
|
22 | 22 | 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob) |
|
23 | 23 | |
|
24 | 24 | # Set the prefetchdays config to zero so that all commits are prefetched |
|
25 | 25 | # no matter what their creation date is. |
|
26 | 26 | $ cd shallow |
|
27 | 27 | $ cat >> .hg/hgrc <<EOF |
|
28 | 28 | > [remotefilelog] |
|
29 | 29 | > prefetchdays=0 |
|
30 | 30 | > EOF |
|
31 | 31 | $ cd .. |
|
32 | 32 | |
|
33 | 33 | # Prefetch all data and repack |
|
34 | 34 | |
|
35 | 35 | $ cd shallow |
|
36 | 36 | $ cat >> .hg/hgrc <<EOF |
|
37 | 37 | > [remotefilelog] |
|
38 | 38 | > bgprefetchrevs=all() |
|
39 | 39 | > EOF |
|
40 | 40 | |
|
41 | 41 | $ hg prefetch |
|
42 | 42 | 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob) |
|
43 | 43 | $ hg repack |
|
44 | 44 | $ sleep 0.5 |
|
45 | 45 | $ hg debugwaitonrepack >/dev/null 2>%1 |
|
46 | 46 | |
|
47 | 47 | $ find $CACHEDIR | sort | grep ".datapack\|.histpack" |
|
48 | 48 | $TESTTMP/hgcache/master/packs/9a2ea858fe2967db9b6ea4c0ca238881cae9d6eb.histpack |
|
49 | 49 | $TESTTMP/hgcache/master/packs/f7a942a6e4673d2c7b697fdd926ca2d153831ca4.datapack |
|
50 | 50 | |
|
51 | 51 | # Ensure that all file versions were prefetched |
|
52 | 52 | |
|
53 |
$ hg debugdatapack $TESTTMP/hgcache/master/packs/ |
|
|
53 | $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1` | |
|
54 | 54 | $TESTTMP/hgcache/master/packs/f7a942a6e4673d2c7b697fdd926ca2d153831ca4: |
|
55 | 55 | x: |
|
56 | 56 | Node Delta Base Delta Length Blob Size |
|
57 | 57 | 1406e7411862 000000000000 2 2 |
|
58 | 58 | |
|
59 | 59 | Total: 2 2 (0.0% bigger) |
|
60 | 60 | y: |
|
61 | 61 | Node Delta Base Delta Length Blob Size |
|
62 | 62 | 50dbc4572b8e 000000000000 3 3 |
|
63 | 63 | 076f5e2225b3 50dbc4572b8e 14 2 |
|
64 | 64 | |
|
65 | 65 | Total: 17 5 (240.0% bigger) |
|
66 | 66 | |
|
67 | 67 | # Test garbage collection during repack |
|
68 | 68 | |
|
69 | 69 | $ cat >> .hg/hgrc <<EOF |
|
70 | 70 | > [remotefilelog] |
|
71 | 71 | > bgprefetchrevs=tip |
|
72 | 72 | > gcrepack=True |
|
73 | 73 | > nodettl=86400 |
|
74 | 74 | > EOF |
|
75 | 75 | |
|
76 | 76 | $ hg repack |
|
77 | 77 | $ sleep 0.5 |
|
78 | 78 | $ hg debugwaitonrepack >/dev/null 2>%1 |
|
79 | 79 | |
|
80 | 80 | $ find $CACHEDIR | sort | grep ".datapack\|.histpack" |
|
81 | 81 | $TESTTMP/hgcache/master/packs/05baa499c6b07f2bf0ea3d2c8151da1cb86f5e33.datapack |
|
82 | 82 | $TESTTMP/hgcache/master/packs/9a2ea858fe2967db9b6ea4c0ca238881cae9d6eb.histpack |
|
83 | 83 | |
|
84 | 84 | # Ensure that file 'x' was garbage collected. It should be GCed because it is not in the keepset |
|
85 | 85 | # and is old (commit date is 0.0 in tests). Ensure that file 'y' is present as it is in the keepset. |
|
86 | 86 | |
|
87 |
$ hg debugdatapack $TESTTMP/hgcache/master/packs/ |
|
|
87 | $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1` | |
|
88 | 88 | $TESTTMP/hgcache/master/packs/05baa499c6b07f2bf0ea3d2c8151da1cb86f5e33: |
|
89 | 89 | y: |
|
90 | 90 | Node Delta Base Delta Length Blob Size |
|
91 | 91 | 50dbc4572b8e 000000000000 3 3 |
|
92 | 92 | |
|
93 | 93 | Total: 3 3 (0.0% bigger) |
|
94 | 94 | |
|
95 | 95 | # Prefetch all data again and repack for later garbage collection |
|
96 | 96 | |
|
97 | 97 | $ cat >> .hg/hgrc <<EOF |
|
98 | 98 | > [remotefilelog] |
|
99 | 99 | > bgprefetchrevs=all() |
|
100 | 100 | > EOF |
|
101 | 101 | |
|
102 | 102 | $ hg prefetch |
|
103 | 103 | 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob) |
|
104 | 104 | $ hg repack |
|
105 | 105 | $ sleep 0.5 |
|
106 | 106 | $ hg debugwaitonrepack >/dev/null 2>%1 |
|
107 | 107 | |
|
108 | 108 | $ find $CACHEDIR | sort | grep ".datapack\|.histpack" |
|
109 | 109 | $TESTTMP/hgcache/master/packs/9a2ea858fe2967db9b6ea4c0ca238881cae9d6eb.histpack |
|
110 | 110 | $TESTTMP/hgcache/master/packs/f7a942a6e4673d2c7b697fdd926ca2d153831ca4.datapack |
|
111 | 111 | |
|
112 | 112 | # Ensure that all file versions were prefetched |
|
113 | 113 | |
|
114 |
$ hg debugdatapack $TESTTMP/hgcache/master/packs/ |
|
|
114 | $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1` | |
|
115 | 115 | $TESTTMP/hgcache/master/packs/f7a942a6e4673d2c7b697fdd926ca2d153831ca4: |
|
116 | 116 | x: |
|
117 | 117 | Node Delta Base Delta Length Blob Size |
|
118 | 118 | 1406e7411862 000000000000 2 2 |
|
119 | 119 | |
|
120 | 120 | Total: 2 2 (0.0% bigger) |
|
121 | 121 | y: |
|
122 | 122 | Node Delta Base Delta Length Blob Size |
|
123 | 123 | 50dbc4572b8e 000000000000 3 3 |
|
124 | 124 | 076f5e2225b3 50dbc4572b8e 14 2 |
|
125 | 125 | |
|
126 | 126 | Total: 17 5 (240.0% bigger) |
|
127 | 127 | |
|
128 | 128 | # Test garbage collection during repack. Ensure that new files are not removed even though they are not in the keepset |
|
129 | 129 | # For the purposes of the test the TTL of a file is set to current time + 100 seconds. i.e. all commits in tests have |
|
130 | 130 | # a date of 1970 and therefore to prevent garbage collection we have to set nodettl to be farther from 1970 than we are now. |
|
131 | 131 | |
|
132 | 132 | $ cat >> .hg/hgrc <<EOF |
|
133 | 133 | > [remotefilelog] |
|
134 | 134 | > bgprefetchrevs= |
|
135 | 135 | > nodettl=$(($(date +%s) + 100)) |
|
136 | 136 | > EOF |
|
137 | 137 | |
|
138 | 138 | $ hg repack |
|
139 | 139 | $ sleep 0.5 |
|
140 | 140 | $ hg debugwaitonrepack >/dev/null 2>%1 |
|
141 | 141 | |
|
142 | 142 | $ find $CACHEDIR | sort | grep ".datapack\|.histpack" |
|
143 | 143 | $TESTTMP/hgcache/master/packs/9a2ea858fe2967db9b6ea4c0ca238881cae9d6eb.histpack |
|
144 | 144 | $TESTTMP/hgcache/master/packs/f7a942a6e4673d2c7b697fdd926ca2d153831ca4.datapack |
|
145 | 145 | |
|
146 | 146 | # Ensure that all file versions were prefetched |
|
147 | 147 | |
|
148 |
$ hg debugdatapack $TESTTMP/hgcache/master/packs/ |
|
|
148 | $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1` | |
|
149 | 149 | $TESTTMP/hgcache/master/packs/f7a942a6e4673d2c7b697fdd926ca2d153831ca4: |
|
150 | 150 | x: |
|
151 | 151 | Node Delta Base Delta Length Blob Size |
|
152 | 152 | 1406e7411862 000000000000 2 2 |
|
153 | 153 | |
|
154 | 154 | Total: 2 2 (0.0% bigger) |
|
155 | 155 | y: |
|
156 | 156 | Node Delta Base Delta Length Blob Size |
|
157 | 157 | 50dbc4572b8e 000000000000 3 3 |
|
158 | 158 | 076f5e2225b3 50dbc4572b8e 14 2 |
|
159 | 159 | |
|
160 | 160 | Total: 17 5 (240.0% bigger) |
General Comments 0
You need to be logged in to leave comments.
Login now