##// END OF EJS Templates
remotefilelog: remove most sleep in tests...
marmoute -
r44300:fac25de8 stable
parent child Browse files
Show More
@@ -1,377 +1,360 b''
1 #require no-windows
1 #require no-windows
2
2
3 $ . "$TESTDIR/remotefilelog-library.sh"
3 $ . "$TESTDIR/remotefilelog-library.sh"
4 # devel.remotefilelog.ensurestart: reduce race condition with
4 # devel.remotefilelog.ensurestart: reduce race condition with
5 # waiton{repack/prefetch}
5 # waiton{repack/prefetch}
6 $ cat >> $HGRCPATH <<EOF
6 $ cat >> $HGRCPATH <<EOF
7 > [devel]
7 > [devel]
8 > remotefilelog.ensurestart=True
8 > remotefilelog.ensurestart=True
9 > remotefilelog.bg-wait=True
9 > remotefilelog.bg-wait=True
10 > EOF
10 > EOF
11
11
12 $ hg init master
12 $ hg init master
13 $ cd master
13 $ cd master
14 $ cat >> .hg/hgrc <<EOF
14 $ cat >> .hg/hgrc <<EOF
15 > [remotefilelog]
15 > [remotefilelog]
16 > server=True
16 > server=True
17 > EOF
17 > EOF
18 $ echo x > x
18 $ echo x > x
19 $ echo z > z
19 $ echo z > z
20 $ hg commit -qAm x
20 $ hg commit -qAm x
21 $ echo x2 > x
21 $ echo x2 > x
22 $ echo y > y
22 $ echo y > y
23 $ hg commit -qAm y
23 $ hg commit -qAm y
24 $ echo w > w
24 $ echo w > w
25 $ rm z
25 $ rm z
26 $ hg commit -qAm w
26 $ hg commit -qAm w
27 $ hg bookmark foo
27 $ hg bookmark foo
28
28
29 $ cd ..
29 $ cd ..
30
30
31 # clone the repo
31 # clone the repo
32
32
33 $ hgcloneshallow ssh://user@dummy/master shallow --noupdate
33 $ hgcloneshallow ssh://user@dummy/master shallow --noupdate
34 streaming all changes
34 streaming all changes
35 2 files to transfer, 776 bytes of data
35 2 files to transfer, 776 bytes of data
36 transferred 776 bytes in * seconds (*/sec) (glob)
36 transferred 776 bytes in * seconds (*/sec) (glob)
37 searching for changes
37 searching for changes
38 no changes found
38 no changes found
39
39
40 # Set the prefetchdays config to zero so that all commits are prefetched
40 # Set the prefetchdays config to zero so that all commits are prefetched
41 # no matter what their creation date is. Also set prefetchdelay config
41 # no matter what their creation date is. Also set prefetchdelay config
42 # to zero so that there is no delay between prefetches.
42 # to zero so that there is no delay between prefetches.
43 $ cd shallow
43 $ cd shallow
44 $ cat >> .hg/hgrc <<EOF
44 $ cat >> .hg/hgrc <<EOF
45 > [remotefilelog]
45 > [remotefilelog]
46 > prefetchdays=0
46 > prefetchdays=0
47 > prefetchdelay=0
47 > prefetchdelay=0
48 > EOF
48 > EOF
49 $ cd ..
49 $ cd ..
50
50
51 # prefetch a revision
51 # prefetch a revision
52 $ cd shallow
52 $ cd shallow
53
53
54 $ hg prefetch -r 0
54 $ hg prefetch -r 0
55 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
55 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
56
56
57 $ hg cat -r 0 x
57 $ hg cat -r 0 x
58 x
58 x
59
59
60 # background prefetch on pull when configured
60 # background prefetch on pull when configured
61
61
62 $ cat >> .hg/hgrc <<EOF
62 $ cat >> .hg/hgrc <<EOF
63 > [remotefilelog]
63 > [remotefilelog]
64 > pullprefetch=bookmark()
64 > pullprefetch=bookmark()
65 > backgroundprefetch=True
65 > backgroundprefetch=True
66 > EOF
66 > EOF
67 $ hg strip tip
67 $ hg strip tip
68 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/6b4b6f66ef8c-b4b8bdaf-backup.hg (glob)
68 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/6b4b6f66ef8c-b4b8bdaf-backup.hg (glob)
69
69
70 $ clearcache
70 $ clearcache
71 $ hg pull
71 $ hg pull
72 pulling from ssh://user@dummy/master
72 pulling from ssh://user@dummy/master
73 searching for changes
73 searching for changes
74 adding changesets
74 adding changesets
75 adding manifests
75 adding manifests
76 adding file changes
76 adding file changes
77 updating bookmark foo
77 updating bookmark foo
78 added 1 changesets with 0 changes to 0 files
78 added 1 changesets with 0 changes to 0 files
79 new changesets 6b4b6f66ef8c
79 new changesets 6b4b6f66ef8c
80 (run 'hg update' to get a working copy)
80 (run 'hg update' to get a working copy)
81 prefetching file contents
81 prefetching file contents
82 $ sleep 0.5
83 $ hg debugwaitonprefetch >/dev/null 2>%1
82 $ hg debugwaitonprefetch >/dev/null 2>%1
84 $ find $CACHEDIR -type f | sort
83 $ find $CACHEDIR -type f | sort
85 $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/ef95c5376f34698742fe34f315fd82136f8f68c0
84 $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/ef95c5376f34698742fe34f315fd82136f8f68c0
86 $TESTTMP/hgcache/master/95/cb0bfd2977c761298d9624e4b4d4c72a39974a/076f5e2225b3ff0400b98c92aa6cdf403ee24cca
85 $TESTTMP/hgcache/master/95/cb0bfd2977c761298d9624e4b4d4c72a39974a/076f5e2225b3ff0400b98c92aa6cdf403ee24cca
87 $TESTTMP/hgcache/master/af/f024fe4ab0fece4091de044c58c9ae4233383a/bb6ccd5dceaa5e9dc220e0dad65e051b94f69a2c
86 $TESTTMP/hgcache/master/af/f024fe4ab0fece4091de044c58c9ae4233383a/bb6ccd5dceaa5e9dc220e0dad65e051b94f69a2c
88 $TESTTMP/hgcache/repos
87 $TESTTMP/hgcache/repos
89
88
90 # background prefetch with repack on pull when configured
89 # background prefetch with repack on pull when configured
91
90
92 $ cat >> .hg/hgrc <<EOF
91 $ cat >> .hg/hgrc <<EOF
93 > [remotefilelog]
92 > [remotefilelog]
94 > backgroundrepack=True
93 > backgroundrepack=True
95 > EOF
94 > EOF
96 $ hg strip tip
95 $ hg strip tip
97 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/6b4b6f66ef8c-b4b8bdaf-backup.hg (glob)
96 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/6b4b6f66ef8c-b4b8bdaf-backup.hg (glob)
98
97
99 $ clearcache
98 $ clearcache
100 $ hg pull
99 $ hg pull
101 pulling from ssh://user@dummy/master
100 pulling from ssh://user@dummy/master
102 searching for changes
101 searching for changes
103 adding changesets
102 adding changesets
104 adding manifests
103 adding manifests
105 adding file changes
104 adding file changes
106 updating bookmark foo
105 updating bookmark foo
107 added 1 changesets with 0 changes to 0 files
106 added 1 changesets with 0 changes to 0 files
108 new changesets 6b4b6f66ef8c
107 new changesets 6b4b6f66ef8c
109 (run 'hg update' to get a working copy)
108 (run 'hg update' to get a working copy)
110 prefetching file contents
109 prefetching file contents
111 $ sleep 0.5
112 $ hg debugwaitonprefetch >/dev/null 2>%1
110 $ hg debugwaitonprefetch >/dev/null 2>%1
113 $ sleep 0.5
114 $ hg debugwaitonrepack >/dev/null 2>%1
111 $ hg debugwaitonrepack >/dev/null 2>%1
115 $ sleep 0.5
116 $ find $CACHEDIR -type f | sort
112 $ find $CACHEDIR -type f | sort
117 $TESTTMP/hgcache/master/packs/6e8633deba6e544e5f8edbd7b996d6e31a2c42ae.histidx
113 $TESTTMP/hgcache/master/packs/6e8633deba6e544e5f8edbd7b996d6e31a2c42ae.histidx
118 $TESTTMP/hgcache/master/packs/6e8633deba6e544e5f8edbd7b996d6e31a2c42ae.histpack
114 $TESTTMP/hgcache/master/packs/6e8633deba6e544e5f8edbd7b996d6e31a2c42ae.histpack
119 $TESTTMP/hgcache/master/packs/8ce5ab3745465ab83bba30a7b9c295e0c8404652.dataidx
115 $TESTTMP/hgcache/master/packs/8ce5ab3745465ab83bba30a7b9c295e0c8404652.dataidx
120 $TESTTMP/hgcache/master/packs/8ce5ab3745465ab83bba30a7b9c295e0c8404652.datapack
116 $TESTTMP/hgcache/master/packs/8ce5ab3745465ab83bba30a7b9c295e0c8404652.datapack
121 $TESTTMP/hgcache/repos
117 $TESTTMP/hgcache/repos
122
118
123 # background prefetch with repack on update when wcprevset configured
119 # background prefetch with repack on update when wcprevset configured
124
120
125 $ clearcache
121 $ clearcache
126 $ hg up -r 0
122 $ hg up -r 0
127 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
123 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
128 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
124 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
129 $ find $CACHEDIR -type f | sort
125 $ find $CACHEDIR -type f | sort
130 $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1406e74118627694268417491f018a4a883152f0
126 $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1406e74118627694268417491f018a4a883152f0
131 $TESTTMP/hgcache/master/39/5df8f7c51f007019cb30201c49e884b46b92fa/69a1b67522704ec122181c0890bd16e9d3e7516a
127 $TESTTMP/hgcache/master/39/5df8f7c51f007019cb30201c49e884b46b92fa/69a1b67522704ec122181c0890bd16e9d3e7516a
132 $TESTTMP/hgcache/repos
128 $TESTTMP/hgcache/repos
133
129
134 $ hg up -r 1
130 $ hg up -r 1
135 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
131 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
136 2 files fetched over 2 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
132 2 files fetched over 2 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
137
133
138 $ cat >> .hg/hgrc <<EOF
134 $ cat >> .hg/hgrc <<EOF
139 > [remotefilelog]
135 > [remotefilelog]
140 > bgprefetchrevs=.::
136 > bgprefetchrevs=.::
141 > EOF
137 > EOF
142
138
143 $ clearcache
139 $ clearcache
144 $ hg up -r 0
140 $ hg up -r 0
145 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
141 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
146 * files fetched over * fetches - (* misses, 0.00% hit ratio) over *s (glob)
142 * files fetched over * fetches - (* misses, 0.00% hit ratio) over *s (glob)
147 $ sleep 1
148 $ hg debugwaitonprefetch >/dev/null 2>%1
143 $ hg debugwaitonprefetch >/dev/null 2>%1
149 $ sleep 1
150 $ hg debugwaitonrepack >/dev/null 2>%1
144 $ hg debugwaitonrepack >/dev/null 2>%1
151 $ sleep 1
152 $ find $CACHEDIR -type f | sort
145 $ find $CACHEDIR -type f | sort
153 $TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histidx
146 $TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histidx
154 $TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histpack
147 $TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histpack
155 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407.dataidx
148 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407.dataidx
156 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407.datapack
149 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407.datapack
157 $TESTTMP/hgcache/repos
150 $TESTTMP/hgcache/repos
158
151
159 # Ensure that file 'w' was prefetched - it was not part of the update operation and therefore
152 # Ensure that file 'w' was prefetched - it was not part of the update operation and therefore
160 # could only be downloaded by the background prefetch
153 # could only be downloaded by the background prefetch
161
154
162 $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1`
155 $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1`
163 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407:
156 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407:
164 w:
157 w:
165 Node Delta Base Delta Length Blob Size
158 Node Delta Base Delta Length Blob Size
166 bb6ccd5dceaa 000000000000 2 2
159 bb6ccd5dceaa 000000000000 2 2
167
160
168 Total: 2 2 (0.0% bigger)
161 Total: 2 2 (0.0% bigger)
169 x:
162 x:
170 Node Delta Base Delta Length Blob Size
163 Node Delta Base Delta Length Blob Size
171 ef95c5376f34 000000000000 3 3
164 ef95c5376f34 000000000000 3 3
172 1406e7411862 ef95c5376f34 14 2
165 1406e7411862 ef95c5376f34 14 2
173
166
174 Total: 17 5 (240.0% bigger)
167 Total: 17 5 (240.0% bigger)
175 y:
168 y:
176 Node Delta Base Delta Length Blob Size
169 Node Delta Base Delta Length Blob Size
177 076f5e2225b3 000000000000 2 2
170 076f5e2225b3 000000000000 2 2
178
171
179 Total: 2 2 (0.0% bigger)
172 Total: 2 2 (0.0% bigger)
180 z:
173 z:
181 Node Delta Base Delta Length Blob Size
174 Node Delta Base Delta Length Blob Size
182 69a1b6752270 000000000000 2 2
175 69a1b6752270 000000000000 2 2
183
176
184 Total: 2 2 (0.0% bigger)
177 Total: 2 2 (0.0% bigger)
185
178
186 # background prefetch with repack on commit when wcprevset configured
179 # background prefetch with repack on commit when wcprevset configured
187
180
188 $ cat >> .hg/hgrc <<EOF
181 $ cat >> .hg/hgrc <<EOF
189 > [remotefilelog]
182 > [remotefilelog]
190 > bgprefetchrevs=0::
183 > bgprefetchrevs=0::
191 > EOF
184 > EOF
192
185
193 $ clearcache
186 $ clearcache
194 $ find $CACHEDIR -type f | sort
187 $ find $CACHEDIR -type f | sort
195 $ echo b > b
188 $ echo b > b
196 $ hg commit -qAm b
189 $ hg commit -qAm b
197 * files fetched over 1 fetches - (* misses, 0.00% hit ratio) over *s (glob)
190 * files fetched over 1 fetches - (* misses, 0.00% hit ratio) over *s (glob)
198 $ hg bookmark temporary
191 $ hg bookmark temporary
199 $ sleep 1
200 $ hg debugwaitonprefetch >/dev/null 2>%1
192 $ hg debugwaitonprefetch >/dev/null 2>%1
201 $ sleep 1
202 $ hg debugwaitonrepack >/dev/null 2>%1
193 $ hg debugwaitonrepack >/dev/null 2>%1
203 $ sleep 1
204 $ find $CACHEDIR -type f | sort
194 $ find $CACHEDIR -type f | sort
205 $TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histidx
195 $TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histidx
206 $TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histpack
196 $TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histpack
207 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407.dataidx
197 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407.dataidx
208 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407.datapack
198 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407.datapack
209 $TESTTMP/hgcache/repos
199 $TESTTMP/hgcache/repos
210
200
211 # Ensure that file 'w' was prefetched - it was not part of the commit operation and therefore
201 # Ensure that file 'w' was prefetched - it was not part of the commit operation and therefore
212 # could only be downloaded by the background prefetch
202 # could only be downloaded by the background prefetch
213
203
214 $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1`
204 $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1`
215 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407:
205 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407:
216 w:
206 w:
217 Node Delta Base Delta Length Blob Size
207 Node Delta Base Delta Length Blob Size
218 bb6ccd5dceaa 000000000000 2 2
208 bb6ccd5dceaa 000000000000 2 2
219
209
220 Total: 2 2 (0.0% bigger)
210 Total: 2 2 (0.0% bigger)
221 x:
211 x:
222 Node Delta Base Delta Length Blob Size
212 Node Delta Base Delta Length Blob Size
223 ef95c5376f34 000000000000 3 3
213 ef95c5376f34 000000000000 3 3
224 1406e7411862 ef95c5376f34 14 2
214 1406e7411862 ef95c5376f34 14 2
225
215
226 Total: 17 5 (240.0% bigger)
216 Total: 17 5 (240.0% bigger)
227 y:
217 y:
228 Node Delta Base Delta Length Blob Size
218 Node Delta Base Delta Length Blob Size
229 076f5e2225b3 000000000000 2 2
219 076f5e2225b3 000000000000 2 2
230
220
231 Total: 2 2 (0.0% bigger)
221 Total: 2 2 (0.0% bigger)
232 z:
222 z:
233 Node Delta Base Delta Length Blob Size
223 Node Delta Base Delta Length Blob Size
234 69a1b6752270 000000000000 2 2
224 69a1b6752270 000000000000 2 2
235
225
236 Total: 2 2 (0.0% bigger)
226 Total: 2 2 (0.0% bigger)
237
227
238 # background prefetch with repack on rebase when wcprevset configured
228 # background prefetch with repack on rebase when wcprevset configured
239
229
240 $ hg up -r 2
230 $ hg up -r 2
241 3 files updated, 0 files merged, 3 files removed, 0 files unresolved
231 3 files updated, 0 files merged, 3 files removed, 0 files unresolved
242 (leaving bookmark temporary)
232 (leaving bookmark temporary)
243 $ clearcache
233 $ clearcache
244 $ find $CACHEDIR -type f | sort
234 $ find $CACHEDIR -type f | sort
245 $ hg rebase -s temporary -d foo
235 $ hg rebase -s temporary -d foo
246 rebasing 3:58147a5b5242 "b" (temporary tip)
236 rebasing 3:58147a5b5242 "b" (temporary tip)
247 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/58147a5b5242-c3678817-rebase.hg
237 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/58147a5b5242-c3678817-rebase.hg
248 3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over *s (glob)
238 3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over *s (glob)
249 $ sleep 1
250 $ hg debugwaitonprefetch >/dev/null 2>%1
239 $ hg debugwaitonprefetch >/dev/null 2>%1
251 $ sleep 1
252 $ hg debugwaitonrepack >/dev/null 2>%1
240 $ hg debugwaitonrepack >/dev/null 2>%1
253 $ sleep 1
254
241
255 # Ensure that file 'y' was prefetched - it was not part of the rebase operation and therefore
242 # Ensure that file 'y' was prefetched - it was not part of the rebase operation and therefore
256 # could only be downloaded by the background prefetch
243 # could only be downloaded by the background prefetch
257
244
258 $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1`
245 $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1`
259 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407:
246 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407:
260 w:
247 w:
261 Node Delta Base Delta Length Blob Size
248 Node Delta Base Delta Length Blob Size
262 bb6ccd5dceaa 000000000000 2 2
249 bb6ccd5dceaa 000000000000 2 2
263
250
264 Total: 2 2 (0.0% bigger)
251 Total: 2 2 (0.0% bigger)
265 x:
252 x:
266 Node Delta Base Delta Length Blob Size
253 Node Delta Base Delta Length Blob Size
267 ef95c5376f34 000000000000 3 3
254 ef95c5376f34 000000000000 3 3
268 1406e7411862 ef95c5376f34 14 2
255 1406e7411862 ef95c5376f34 14 2
269
256
270 Total: 17 5 (240.0% bigger)
257 Total: 17 5 (240.0% bigger)
271 y:
258 y:
272 Node Delta Base Delta Length Blob Size
259 Node Delta Base Delta Length Blob Size
273 076f5e2225b3 000000000000 2 2
260 076f5e2225b3 000000000000 2 2
274
261
275 Total: 2 2 (0.0% bigger)
262 Total: 2 2 (0.0% bigger)
276 z:
263 z:
277 Node Delta Base Delta Length Blob Size
264 Node Delta Base Delta Length Blob Size
278 69a1b6752270 000000000000 2 2
265 69a1b6752270 000000000000 2 2
279
266
280 Total: 2 2 (0.0% bigger)
267 Total: 2 2 (0.0% bigger)
281
268
282 # Check that foregound prefetch with no arguments blocks until background prefetches finish
269 # Check that foregound prefetch with no arguments blocks until background prefetches finish
283
270
284 $ hg up -r 3
271 $ hg up -r 3
285 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
272 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
286 $ clearcache
273 $ clearcache
287 $ hg prefetch --repack
274 $ hg prefetch --repack
288 waiting for lock on prefetching in $TESTTMP/shallow held by process * on host * (glob) (?)
275 waiting for lock on prefetching in $TESTTMP/shallow held by process * on host * (glob) (?)
289 got lock after * seconds (glob) (?)
276 got lock after * seconds (glob) (?)
290 (running background incremental repack)
277 (running background incremental repack)
291 * files fetched over 1 fetches - (* misses, 0.00% hit ratio) over *s (glob) (?)
278 * files fetched over 1 fetches - (* misses, 0.00% hit ratio) over *s (glob) (?)
292
279
293 $ sleep 0.5
294 $ hg debugwaitonrepack >/dev/null 2>%1
280 $ hg debugwaitonrepack >/dev/null 2>%1
295 $ sleep 0.5
296
281
297 $ find $CACHEDIR -type f | sort
282 $ find $CACHEDIR -type f | sort
298 $TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histidx
283 $TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histidx
299 $TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histpack
284 $TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histpack
300 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407.dataidx
285 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407.dataidx
301 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407.datapack
286 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407.datapack
302 $TESTTMP/hgcache/repos
287 $TESTTMP/hgcache/repos
303
288
304 # Ensure that files were prefetched
289 # Ensure that files were prefetched
305 $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1`
290 $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1`
306 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407:
291 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407:
307 w:
292 w:
308 Node Delta Base Delta Length Blob Size
293 Node Delta Base Delta Length Blob Size
309 bb6ccd5dceaa 000000000000 2 2
294 bb6ccd5dceaa 000000000000 2 2
310
295
311 Total: 2 2 (0.0% bigger)
296 Total: 2 2 (0.0% bigger)
312 x:
297 x:
313 Node Delta Base Delta Length Blob Size
298 Node Delta Base Delta Length Blob Size
314 ef95c5376f34 000000000000 3 3
299 ef95c5376f34 000000000000 3 3
315 1406e7411862 ef95c5376f34 14 2
300 1406e7411862 ef95c5376f34 14 2
316
301
317 Total: 17 5 (240.0% bigger)
302 Total: 17 5 (240.0% bigger)
318 y:
303 y:
319 Node Delta Base Delta Length Blob Size
304 Node Delta Base Delta Length Blob Size
320 076f5e2225b3 000000000000 2 2
305 076f5e2225b3 000000000000 2 2
321
306
322 Total: 2 2 (0.0% bigger)
307 Total: 2 2 (0.0% bigger)
323 z:
308 z:
324 Node Delta Base Delta Length Blob Size
309 Node Delta Base Delta Length Blob Size
325 69a1b6752270 000000000000 2 2
310 69a1b6752270 000000000000 2 2
326
311
327 Total: 2 2 (0.0% bigger)
312 Total: 2 2 (0.0% bigger)
328
313
329 # Check that foreground prefetch fetches revs specified by '. + draft() + bgprefetchrevs + pullprefetch'
314 # Check that foreground prefetch fetches revs specified by '. + draft() + bgprefetchrevs + pullprefetch'
330
315
331 $ clearcache
316 $ clearcache
332 $ hg prefetch --repack
317 $ hg prefetch --repack
333 waiting for lock on prefetching in $TESTTMP/shallow held by process * on host * (glob) (?)
318 waiting for lock on prefetching in $TESTTMP/shallow held by process * on host * (glob) (?)
334 got lock after * seconds (glob) (?)
319 got lock after * seconds (glob) (?)
335 (running background incremental repack)
320 (running background incremental repack)
336 * files fetched over 1 fetches - (* misses, 0.00% hit ratio) over *s (glob) (?)
321 * files fetched over 1 fetches - (* misses, 0.00% hit ratio) over *s (glob) (?)
337 $ sleep 0.5
338 $ hg debugwaitonrepack >/dev/null 2>%1
322 $ hg debugwaitonrepack >/dev/null 2>%1
339 $ sleep 0.5
340
323
341 $ find $CACHEDIR -type f | sort
324 $ find $CACHEDIR -type f | sort
342 $TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histidx
325 $TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histidx
343 $TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histpack
326 $TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histpack
344 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407.dataidx
327 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407.dataidx
345 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407.datapack
328 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407.datapack
346 $TESTTMP/hgcache/repos
329 $TESTTMP/hgcache/repos
347
330
348 # Ensure that files were prefetched
331 # Ensure that files were prefetched
349 $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1`
332 $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1`
350 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407:
333 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407:
351 w:
334 w:
352 Node Delta Base Delta Length Blob Size
335 Node Delta Base Delta Length Blob Size
353 bb6ccd5dceaa 000000000000 2 2
336 bb6ccd5dceaa 000000000000 2 2
354
337
355 Total: 2 2 (0.0% bigger)
338 Total: 2 2 (0.0% bigger)
356 x:
339 x:
357 Node Delta Base Delta Length Blob Size
340 Node Delta Base Delta Length Blob Size
358 ef95c5376f34 000000000000 3 3
341 ef95c5376f34 000000000000 3 3
359 1406e7411862 ef95c5376f34 14 2
342 1406e7411862 ef95c5376f34 14 2
360
343
361 Total: 17 5 (240.0% bigger)
344 Total: 17 5 (240.0% bigger)
362 y:
345 y:
363 Node Delta Base Delta Length Blob Size
346 Node Delta Base Delta Length Blob Size
364 076f5e2225b3 000000000000 2 2
347 076f5e2225b3 000000000000 2 2
365
348
366 Total: 2 2 (0.0% bigger)
349 Total: 2 2 (0.0% bigger)
367 z:
350 z:
368 Node Delta Base Delta Length Blob Size
351 Node Delta Base Delta Length Blob Size
369 69a1b6752270 000000000000 2 2
352 69a1b6752270 000000000000 2 2
370
353
371 Total: 2 2 (0.0% bigger)
354 Total: 2 2 (0.0% bigger)
372
355
373 # Test that if data was prefetched and repacked we dont need to prefetch it again
356 # Test that if data was prefetched and repacked we dont need to prefetch it again
374 # It ensures that Mercurial looks not only in loose files but in packs as well
357 # It ensures that Mercurial looks not only in loose files but in packs as well
375
358
376 $ hg prefetch --repack
359 $ hg prefetch --repack
377 (running background incremental repack)
360 (running background incremental repack)
@@ -1,159 +1,155 b''
1 #require no-windows
1 #require no-windows
2
2
3 $ . "$TESTDIR/remotefilelog-library.sh"
3 $ . "$TESTDIR/remotefilelog-library.sh"
4
4
5 $ hg init master
5 $ hg init master
6 $ cd master
6 $ cd master
7 $ cat >> .hg/hgrc <<EOF
7 $ cat >> .hg/hgrc <<EOF
8 > [remotefilelog]
8 > [remotefilelog]
9 > server=True
9 > server=True
10 > EOF
10 > EOF
11 $ echo x > x
11 $ echo x > x
12 $ hg commit -qAm x
12 $ hg commit -qAm x
13 $ echo y > y
13 $ echo y > y
14 $ rm x
14 $ rm x
15 $ hg commit -qAm DxAy
15 $ hg commit -qAm DxAy
16 $ echo yy > y
16 $ echo yy > y
17 $ hg commit -qAm y
17 $ hg commit -qAm y
18 $ cd ..
18 $ cd ..
19
19
20 $ hgcloneshallow ssh://user@dummy/master shallow -q
20 $ hgcloneshallow ssh://user@dummy/master shallow -q
21 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
21 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
22
22
23 # Set the prefetchdays config to zero so that all commits are prefetched
23 # Set the prefetchdays config to zero so that all commits are prefetched
24 # no matter what their creation date is.
24 # no matter what their creation date is.
25 $ cd shallow
25 $ cd shallow
26 $ cat >> .hg/hgrc <<EOF
26 $ cat >> .hg/hgrc <<EOF
27 > [remotefilelog]
27 > [remotefilelog]
28 > prefetchdays=0
28 > prefetchdays=0
29 > EOF
29 > EOF
30 $ cd ..
30 $ cd ..
31
31
32 # Prefetch all data and repack
32 # Prefetch all data and repack
33
33
34 $ cd shallow
34 $ cd shallow
35 $ cat >> .hg/hgrc <<EOF
35 $ cat >> .hg/hgrc <<EOF
36 > [remotefilelog]
36 > [remotefilelog]
37 > bgprefetchrevs=all()
37 > bgprefetchrevs=all()
38 > EOF
38 > EOF
39
39
40 $ hg prefetch
40 $ hg prefetch
41 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
41 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
42 $ hg repack
42 $ hg repack
43 $ sleep 0.5
44 $ hg debugwaitonrepack >/dev/null 2>%1
43 $ hg debugwaitonrepack >/dev/null 2>%1
45
44
46 $ find $CACHEDIR | sort | egrep ".datapack|.histpack"
45 $ find $CACHEDIR | sort | egrep ".datapack|.histpack"
47 $TESTTMP/hgcache/master/packs/7bcd2d90b99395ca43172a0dd24e18860b2902f9.histpack
46 $TESTTMP/hgcache/master/packs/7bcd2d90b99395ca43172a0dd24e18860b2902f9.histpack
48 $TESTTMP/hgcache/master/packs/dc8f8fdc76690ce27791ce9f53a18da379e50d37.datapack
47 $TESTTMP/hgcache/master/packs/dc8f8fdc76690ce27791ce9f53a18da379e50d37.datapack
49
48
50 # Ensure that all file versions were prefetched
49 # Ensure that all file versions were prefetched
51
50
52 $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1`
51 $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1`
53 $TESTTMP/hgcache/master/packs/dc8f8fdc76690ce27791ce9f53a18da379e50d37:
52 $TESTTMP/hgcache/master/packs/dc8f8fdc76690ce27791ce9f53a18da379e50d37:
54 x:
53 x:
55 Node Delta Base Delta Length Blob Size
54 Node Delta Base Delta Length Blob Size
56 1406e7411862 000000000000 2 2
55 1406e7411862 000000000000 2 2
57
56
58 Total: 2 2 (0.0% bigger)
57 Total: 2 2 (0.0% bigger)
59 y:
58 y:
60 Node Delta Base Delta Length Blob Size
59 Node Delta Base Delta Length Blob Size
61 50dbc4572b8e 000000000000 3 3
60 50dbc4572b8e 000000000000 3 3
62 076f5e2225b3 50dbc4572b8e 14 2
61 076f5e2225b3 50dbc4572b8e 14 2
63
62
64 Total: 17 5 (240.0% bigger)
63 Total: 17 5 (240.0% bigger)
65
64
66 # Test garbage collection during repack
65 # Test garbage collection during repack
67
66
68 $ cat >> .hg/hgrc <<EOF
67 $ cat >> .hg/hgrc <<EOF
69 > [remotefilelog]
68 > [remotefilelog]
70 > bgprefetchrevs=tip
69 > bgprefetchrevs=tip
71 > gcrepack=True
70 > gcrepack=True
72 > nodettl=86400
71 > nodettl=86400
73 > EOF
72 > EOF
74
73
75 $ hg repack
74 $ hg repack
76 $ sleep 0.5
77 $ hg debugwaitonrepack >/dev/null 2>%1
75 $ hg debugwaitonrepack >/dev/null 2>%1
78
76
79 $ find $CACHEDIR | sort | egrep ".datapack|.histpack"
77 $ find $CACHEDIR | sort | egrep ".datapack|.histpack"
80 $TESTTMP/hgcache/master/packs/7bcd2d90b99395ca43172a0dd24e18860b2902f9.histpack
78 $TESTTMP/hgcache/master/packs/7bcd2d90b99395ca43172a0dd24e18860b2902f9.histpack
81 $TESTTMP/hgcache/master/packs/a4e1d094ec2aee8a08a4d6d95a13c634cc7d7394.datapack
79 $TESTTMP/hgcache/master/packs/a4e1d094ec2aee8a08a4d6d95a13c634cc7d7394.datapack
82
80
83 # Ensure that file 'x' was garbage collected. It should be GCed because it is not in the keepset
81 # Ensure that file 'x' was garbage collected. It should be GCed because it is not in the keepset
84 # and is old (commit date is 0.0 in tests). Ensure that file 'y' is present as it is in the keepset.
82 # and is old (commit date is 0.0 in tests). Ensure that file 'y' is present as it is in the keepset.
85
83
86 $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1`
84 $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1`
87 $TESTTMP/hgcache/master/packs/a4e1d094ec2aee8a08a4d6d95a13c634cc7d7394:
85 $TESTTMP/hgcache/master/packs/a4e1d094ec2aee8a08a4d6d95a13c634cc7d7394:
88 y:
86 y:
89 Node Delta Base Delta Length Blob Size
87 Node Delta Base Delta Length Blob Size
90 50dbc4572b8e 000000000000 3 3
88 50dbc4572b8e 000000000000 3 3
91
89
92 Total: 3 3 (0.0% bigger)
90 Total: 3 3 (0.0% bigger)
93
91
94 # Prefetch all data again and repack for later garbage collection
92 # Prefetch all data again and repack for later garbage collection
95
93
96 $ cat >> .hg/hgrc <<EOF
94 $ cat >> .hg/hgrc <<EOF
97 > [remotefilelog]
95 > [remotefilelog]
98 > bgprefetchrevs=all()
96 > bgprefetchrevs=all()
99 > EOF
97 > EOF
100
98
101 $ hg prefetch
99 $ hg prefetch
102 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
100 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
103 $ hg repack
101 $ hg repack
104 $ sleep 0.5
105 $ hg debugwaitonrepack >/dev/null 2>%1
102 $ hg debugwaitonrepack >/dev/null 2>%1
106
103
107 $ find $CACHEDIR | sort | egrep ".datapack|.histpack"
104 $ find $CACHEDIR | sort | egrep ".datapack|.histpack"
108 $TESTTMP/hgcache/master/packs/7bcd2d90b99395ca43172a0dd24e18860b2902f9.histpack
105 $TESTTMP/hgcache/master/packs/7bcd2d90b99395ca43172a0dd24e18860b2902f9.histpack
109 $TESTTMP/hgcache/master/packs/dc8f8fdc76690ce27791ce9f53a18da379e50d37.datapack
106 $TESTTMP/hgcache/master/packs/dc8f8fdc76690ce27791ce9f53a18da379e50d37.datapack
110
107
111 # Ensure that all file versions were prefetched
108 # Ensure that all file versions were prefetched
112
109
113 $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1`
110 $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1`
114 $TESTTMP/hgcache/master/packs/dc8f8fdc76690ce27791ce9f53a18da379e50d37:
111 $TESTTMP/hgcache/master/packs/dc8f8fdc76690ce27791ce9f53a18da379e50d37:
115 x:
112 x:
116 Node Delta Base Delta Length Blob Size
113 Node Delta Base Delta Length Blob Size
117 1406e7411862 000000000000 2 2
114 1406e7411862 000000000000 2 2
118
115
119 Total: 2 2 (0.0% bigger)
116 Total: 2 2 (0.0% bigger)
120 y:
117 y:
121 Node Delta Base Delta Length Blob Size
118 Node Delta Base Delta Length Blob Size
122 50dbc4572b8e 000000000000 3 3
119 50dbc4572b8e 000000000000 3 3
123 076f5e2225b3 50dbc4572b8e 14 2
120 076f5e2225b3 50dbc4572b8e 14 2
124
121
125 Total: 17 5 (240.0% bigger)
122 Total: 17 5 (240.0% bigger)
126
123
127 # Test garbage collection during repack. Ensure that new files are not removed even though they are not in the keepset
124 # Test garbage collection during repack. Ensure that new files are not removed even though they are not in the keepset
128 # 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
125 # 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
129 # a date of 1970 and therefore to prevent garbage collection we have to set nodettl to be farther from 1970 than we are now.
126 # a date of 1970 and therefore to prevent garbage collection we have to set nodettl to be farther from 1970 than we are now.
130
127
131 $ cat >> .hg/hgrc <<EOF
128 $ cat >> .hg/hgrc <<EOF
132 > [remotefilelog]
129 > [remotefilelog]
133 > bgprefetchrevs=
130 > bgprefetchrevs=
134 > nodettl=$(($(date +%s) + 100))
131 > nodettl=$(($(date +%s) + 100))
135 > EOF
132 > EOF
136
133
137 $ hg repack
134 $ hg repack
138 $ sleep 0.5
139 $ hg debugwaitonrepack >/dev/null 2>%1
135 $ hg debugwaitonrepack >/dev/null 2>%1
140
136
141 $ find $CACHEDIR | sort | egrep ".datapack|.histpack"
137 $ find $CACHEDIR | sort | egrep ".datapack|.histpack"
142 $TESTTMP/hgcache/master/packs/7bcd2d90b99395ca43172a0dd24e18860b2902f9.histpack
138 $TESTTMP/hgcache/master/packs/7bcd2d90b99395ca43172a0dd24e18860b2902f9.histpack
143 $TESTTMP/hgcache/master/packs/dc8f8fdc76690ce27791ce9f53a18da379e50d37.datapack
139 $TESTTMP/hgcache/master/packs/dc8f8fdc76690ce27791ce9f53a18da379e50d37.datapack
144
140
145 # Ensure that all file versions were prefetched
141 # Ensure that all file versions were prefetched
146
142
147 $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1`
143 $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1`
148 $TESTTMP/hgcache/master/packs/dc8f8fdc76690ce27791ce9f53a18da379e50d37:
144 $TESTTMP/hgcache/master/packs/dc8f8fdc76690ce27791ce9f53a18da379e50d37:
149 x:
145 x:
150 Node Delta Base Delta Length Blob Size
146 Node Delta Base Delta Length Blob Size
151 1406e7411862 000000000000 2 2
147 1406e7411862 000000000000 2 2
152
148
153 Total: 2 2 (0.0% bigger)
149 Total: 2 2 (0.0% bigger)
154 y:
150 y:
155 Node Delta Base Delta Length Blob Size
151 Node Delta Base Delta Length Blob Size
156 50dbc4572b8e 000000000000 3 3
152 50dbc4572b8e 000000000000 3 3
157 076f5e2225b3 50dbc4572b8e 14 2
153 076f5e2225b3 50dbc4572b8e 14 2
158
154
159 Total: 17 5 (240.0% bigger)
155 Total: 17 5 (240.0% bigger)
@@ -1,380 +1,378 b''
1 #require no-windows
1 #require no-windows
2
2
3 $ . "$TESTDIR/remotefilelog-library.sh"
3 $ . "$TESTDIR/remotefilelog-library.sh"
4 # devel.remotefilelog.ensurestart: reduce race condition with
4 # devel.remotefilelog.ensurestart: reduce race condition with
5 # waiton{repack/prefetch}
5 # waiton{repack/prefetch}
6 $ cat >> $HGRCPATH <<EOF
6 $ cat >> $HGRCPATH <<EOF
7 > [remotefilelog]
7 > [remotefilelog]
8 > fastdatapack=True
8 > fastdatapack=True
9 > [devel]
9 > [devel]
10 > remotefilelog.ensurestart=True
10 > remotefilelog.ensurestart=True
11 > remotefilelog.bg-wait=True
11 > remotefilelog.bg-wait=True
12 > EOF
12 > EOF
13
13
14 $ hg init master
14 $ hg init master
15 $ cd master
15 $ cd master
16 $ cat >> .hg/hgrc <<EOF
16 $ cat >> .hg/hgrc <<EOF
17 > [remotefilelog]
17 > [remotefilelog]
18 > server=True
18 > server=True
19 > serverexpiration=-1
19 > serverexpiration=-1
20 > EOF
20 > EOF
21 $ echo x > x
21 $ echo x > x
22 $ hg commit -qAm x
22 $ hg commit -qAm x
23 $ echo x >> x
23 $ echo x >> x
24 $ hg commit -qAm x2
24 $ hg commit -qAm x2
25 $ cd ..
25 $ cd ..
26
26
27 $ hgcloneshallow ssh://user@dummy/master shallow -q
27 $ hgcloneshallow ssh://user@dummy/master shallow -q
28 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
28 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
29
29
30 # Set the prefetchdays config to zero so that all commits are prefetched
30 # Set the prefetchdays config to zero so that all commits are prefetched
31 # no matter what their creation date is.
31 # no matter what their creation date is.
32 $ cd shallow
32 $ cd shallow
33 $ cat >> .hg/hgrc <<EOF
33 $ cat >> .hg/hgrc <<EOF
34 > [remotefilelog]
34 > [remotefilelog]
35 > prefetchdays=0
35 > prefetchdays=0
36 > EOF
36 > EOF
37 $ cd ..
37 $ cd ..
38
38
39 # Test that repack cleans up the old files and creates new packs
39 # Test that repack cleans up the old files and creates new packs
40
40
41 $ cd shallow
41 $ cd shallow
42 $ find $CACHEDIR | sort
42 $ find $CACHEDIR | sort
43 $TESTTMP/hgcache
43 $TESTTMP/hgcache
44 $TESTTMP/hgcache/master
44 $TESTTMP/hgcache/master
45 $TESTTMP/hgcache/master/11
45 $TESTTMP/hgcache/master/11
46 $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072
46 $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072
47 $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/aee31534993a501858fb6dd96a065671922e7d51
47 $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/aee31534993a501858fb6dd96a065671922e7d51
48 $TESTTMP/hgcache/repos
48 $TESTTMP/hgcache/repos
49
49
50 $ hg repack
50 $ hg repack
51
51
52 $ find $CACHEDIR | sort
52 $ find $CACHEDIR | sort
53 $TESTTMP/hgcache
53 $TESTTMP/hgcache
54 $TESTTMP/hgcache/master
54 $TESTTMP/hgcache/master
55 $TESTTMP/hgcache/master/packs
55 $TESTTMP/hgcache/master/packs
56 $TESTTMP/hgcache/master/packs/1e91b207daf5d7b48f1be9c587d6b5ae654ce78c.histidx
56 $TESTTMP/hgcache/master/packs/1e91b207daf5d7b48f1be9c587d6b5ae654ce78c.histidx
57 $TESTTMP/hgcache/master/packs/1e91b207daf5d7b48f1be9c587d6b5ae654ce78c.histpack
57 $TESTTMP/hgcache/master/packs/1e91b207daf5d7b48f1be9c587d6b5ae654ce78c.histpack
58 $TESTTMP/hgcache/master/packs/b1e0cfc7f345e408a7825e3081501959488d59ce.dataidx
58 $TESTTMP/hgcache/master/packs/b1e0cfc7f345e408a7825e3081501959488d59ce.dataidx
59 $TESTTMP/hgcache/master/packs/b1e0cfc7f345e408a7825e3081501959488d59ce.datapack
59 $TESTTMP/hgcache/master/packs/b1e0cfc7f345e408a7825e3081501959488d59ce.datapack
60 $TESTTMP/hgcache/repos
60 $TESTTMP/hgcache/repos
61
61
62 # Test that the packs are readonly
62 # Test that the packs are readonly
63 $ ls_l $CACHEDIR/master/packs
63 $ ls_l $CACHEDIR/master/packs
64 -r--r--r-- 1145 1e91b207daf5d7b48f1be9c587d6b5ae654ce78c.histidx
64 -r--r--r-- 1145 1e91b207daf5d7b48f1be9c587d6b5ae654ce78c.histidx
65 -r--r--r-- 172 1e91b207daf5d7b48f1be9c587d6b5ae654ce78c.histpack
65 -r--r--r-- 172 1e91b207daf5d7b48f1be9c587d6b5ae654ce78c.histpack
66 -r--r--r-- 1074 b1e0cfc7f345e408a7825e3081501959488d59ce.dataidx
66 -r--r--r-- 1074 b1e0cfc7f345e408a7825e3081501959488d59ce.dataidx
67 -r--r--r-- 72 b1e0cfc7f345e408a7825e3081501959488d59ce.datapack
67 -r--r--r-- 72 b1e0cfc7f345e408a7825e3081501959488d59ce.datapack
68
68
69 # Test that the data in the new packs is accessible
69 # Test that the data in the new packs is accessible
70 $ hg cat -r . x
70 $ hg cat -r . x
71 x
71 x
72 x
72 x
73
73
74 # Test that adding new data and repacking it results in the loose data and the
74 # Test that adding new data and repacking it results in the loose data and the
75 # old packs being combined.
75 # old packs being combined.
76
76
77 $ cd ../master
77 $ cd ../master
78 $ echo x >> x
78 $ echo x >> x
79 $ hg commit -m x3
79 $ hg commit -m x3
80 $ cd ../shallow
80 $ cd ../shallow
81 $ hg pull -q
81 $ hg pull -q
82 $ hg up -q tip
82 $ hg up -q tip
83 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
83 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
84
84
85 $ find $CACHEDIR -type f | sort
85 $ find $CACHEDIR -type f | sort
86 $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/d4a3ed9310e5bd9887e3bf779da5077efab28216
86 $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/d4a3ed9310e5bd9887e3bf779da5077efab28216
87 $TESTTMP/hgcache/master/packs/1e91b207daf5d7b48f1be9c587d6b5ae654ce78c.histidx
87 $TESTTMP/hgcache/master/packs/1e91b207daf5d7b48f1be9c587d6b5ae654ce78c.histidx
88 $TESTTMP/hgcache/master/packs/1e91b207daf5d7b48f1be9c587d6b5ae654ce78c.histpack
88 $TESTTMP/hgcache/master/packs/1e91b207daf5d7b48f1be9c587d6b5ae654ce78c.histpack
89 $TESTTMP/hgcache/master/packs/b1e0cfc7f345e408a7825e3081501959488d59ce.dataidx
89 $TESTTMP/hgcache/master/packs/b1e0cfc7f345e408a7825e3081501959488d59ce.dataidx
90 $TESTTMP/hgcache/master/packs/b1e0cfc7f345e408a7825e3081501959488d59ce.datapack
90 $TESTTMP/hgcache/master/packs/b1e0cfc7f345e408a7825e3081501959488d59ce.datapack
91 $TESTTMP/hgcache/repos
91 $TESTTMP/hgcache/repos
92
92
93 $ hg repack --traceback
93 $ hg repack --traceback
94
94
95 $ find $CACHEDIR -type f | sort
95 $ find $CACHEDIR -type f | sort
96 $TESTTMP/hgcache/master/packs/78840d69389c7404327f7477e3931c89945c37d1.dataidx
96 $TESTTMP/hgcache/master/packs/78840d69389c7404327f7477e3931c89945c37d1.dataidx
97 $TESTTMP/hgcache/master/packs/78840d69389c7404327f7477e3931c89945c37d1.datapack
97 $TESTTMP/hgcache/master/packs/78840d69389c7404327f7477e3931c89945c37d1.datapack
98 $TESTTMP/hgcache/master/packs/8abe7889aae389337d12ebe6085d4ee13854c7c9.histidx
98 $TESTTMP/hgcache/master/packs/8abe7889aae389337d12ebe6085d4ee13854c7c9.histidx
99 $TESTTMP/hgcache/master/packs/8abe7889aae389337d12ebe6085d4ee13854c7c9.histpack
99 $TESTTMP/hgcache/master/packs/8abe7889aae389337d12ebe6085d4ee13854c7c9.histpack
100 $TESTTMP/hgcache/repos
100 $TESTTMP/hgcache/repos
101
101
102 # Verify all the file data is still available
102 # Verify all the file data is still available
103 $ hg cat -r . x
103 $ hg cat -r . x
104 x
104 x
105 x
105 x
106 x
106 x
107 $ hg cat -r '.^' x
107 $ hg cat -r '.^' x
108 x
108 x
109 x
109 x
110
110
111 # Test that repacking again without new data does not delete the pack files
111 # Test that repacking again without new data does not delete the pack files
112 # and did not change the pack names
112 # and did not change the pack names
113 $ hg repack
113 $ hg repack
114 $ find $CACHEDIR -type f | sort
114 $ find $CACHEDIR -type f | sort
115 $TESTTMP/hgcache/master/packs/78840d69389c7404327f7477e3931c89945c37d1.dataidx
115 $TESTTMP/hgcache/master/packs/78840d69389c7404327f7477e3931c89945c37d1.dataidx
116 $TESTTMP/hgcache/master/packs/78840d69389c7404327f7477e3931c89945c37d1.datapack
116 $TESTTMP/hgcache/master/packs/78840d69389c7404327f7477e3931c89945c37d1.datapack
117 $TESTTMP/hgcache/master/packs/8abe7889aae389337d12ebe6085d4ee13854c7c9.histidx
117 $TESTTMP/hgcache/master/packs/8abe7889aae389337d12ebe6085d4ee13854c7c9.histidx
118 $TESTTMP/hgcache/master/packs/8abe7889aae389337d12ebe6085d4ee13854c7c9.histpack
118 $TESTTMP/hgcache/master/packs/8abe7889aae389337d12ebe6085d4ee13854c7c9.histpack
119 $TESTTMP/hgcache/repos
119 $TESTTMP/hgcache/repos
120
120
121 # Run two repacks at once
121 # Run two repacks at once
122 $ hg repack --config "hooks.prerepack=sleep 3" &
122 $ hg repack --config "hooks.prerepack=sleep 3" &
123 $ sleep 1
123 $ sleep 1
124 $ hg repack
124 $ hg repack
125 skipping repack - another repack is already running
125 skipping repack - another repack is already running
126 $ hg debugwaitonrepack >/dev/null 2>&1
126 $ hg debugwaitonrepack >/dev/null 2>&1
127
127
128 # Run repack in the background
128 # Run repack in the background
129 $ cd ../master
129 $ cd ../master
130 $ echo x >> x
130 $ echo x >> x
131 $ hg commit -m x4
131 $ hg commit -m x4
132 $ cd ../shallow
132 $ cd ../shallow
133 $ hg pull -q
133 $ hg pull -q
134 $ hg up -q tip
134 $ hg up -q tip
135 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
135 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
136 $ find $CACHEDIR -type f | sort
136 $ find $CACHEDIR -type f | sort
137 $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1bb2e6237e035c8f8ef508e281f1ce075bc6db72
137 $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1bb2e6237e035c8f8ef508e281f1ce075bc6db72
138 $TESTTMP/hgcache/master/packs/78840d69389c7404327f7477e3931c89945c37d1.dataidx
138 $TESTTMP/hgcache/master/packs/78840d69389c7404327f7477e3931c89945c37d1.dataidx
139 $TESTTMP/hgcache/master/packs/78840d69389c7404327f7477e3931c89945c37d1.datapack
139 $TESTTMP/hgcache/master/packs/78840d69389c7404327f7477e3931c89945c37d1.datapack
140 $TESTTMP/hgcache/master/packs/8abe7889aae389337d12ebe6085d4ee13854c7c9.histidx
140 $TESTTMP/hgcache/master/packs/8abe7889aae389337d12ebe6085d4ee13854c7c9.histidx
141 $TESTTMP/hgcache/master/packs/8abe7889aae389337d12ebe6085d4ee13854c7c9.histpack
141 $TESTTMP/hgcache/master/packs/8abe7889aae389337d12ebe6085d4ee13854c7c9.histpack
142 $TESTTMP/hgcache/repos
142 $TESTTMP/hgcache/repos
143
143
144 $ hg repack --background
144 $ hg repack --background
145 (running background repack)
145 (running background repack)
146 $ sleep 0.5
147 $ hg debugwaitonrepack >/dev/null 2>&1
146 $ hg debugwaitonrepack >/dev/null 2>&1
148 $ find $CACHEDIR -type f | sort
147 $ find $CACHEDIR -type f | sort
149 $TESTTMP/hgcache/master/packs/39443fa1064182e93d968b5cba292eb5283260d0.dataidx
148 $TESTTMP/hgcache/master/packs/39443fa1064182e93d968b5cba292eb5283260d0.dataidx
150 $TESTTMP/hgcache/master/packs/39443fa1064182e93d968b5cba292eb5283260d0.datapack
149 $TESTTMP/hgcache/master/packs/39443fa1064182e93d968b5cba292eb5283260d0.datapack
151 $TESTTMP/hgcache/master/packs/604552d403a1381749faf656feca0ca265a6d52c.histidx
150 $TESTTMP/hgcache/master/packs/604552d403a1381749faf656feca0ca265a6d52c.histidx
152 $TESTTMP/hgcache/master/packs/604552d403a1381749faf656feca0ca265a6d52c.histpack
151 $TESTTMP/hgcache/master/packs/604552d403a1381749faf656feca0ca265a6d52c.histpack
153 $TESTTMP/hgcache/repos
152 $TESTTMP/hgcache/repos
154
153
155 # Test debug commands
154 # Test debug commands
156
155
157 $ hg debugdatapack $TESTTMP/hgcache/master/packs/*.datapack
156 $ hg debugdatapack $TESTTMP/hgcache/master/packs/*.datapack
158 $TESTTMP/hgcache/master/packs/39443fa1064182e93d968b5cba292eb5283260d0:
157 $TESTTMP/hgcache/master/packs/39443fa1064182e93d968b5cba292eb5283260d0:
159 x:
158 x:
160 Node Delta Base Delta Length Blob Size
159 Node Delta Base Delta Length Blob Size
161 1bb2e6237e03 000000000000 8 8
160 1bb2e6237e03 000000000000 8 8
162 d4a3ed9310e5 1bb2e6237e03 12 6
161 d4a3ed9310e5 1bb2e6237e03 12 6
163 aee31534993a d4a3ed9310e5 12 4
162 aee31534993a d4a3ed9310e5 12 4
164
163
165 Total: 32 18 (77.8% bigger)
164 Total: 32 18 (77.8% bigger)
166 $ hg debugdatapack --long $TESTTMP/hgcache/master/packs/*.datapack
165 $ hg debugdatapack --long $TESTTMP/hgcache/master/packs/*.datapack
167 $TESTTMP/hgcache/master/packs/39443fa1064182e93d968b5cba292eb5283260d0:
166 $TESTTMP/hgcache/master/packs/39443fa1064182e93d968b5cba292eb5283260d0:
168 x:
167 x:
169 Node Delta Base Delta Length Blob Size
168 Node Delta Base Delta Length Blob Size
170 1bb2e6237e035c8f8ef508e281f1ce075bc6db72 0000000000000000000000000000000000000000 8 8
169 1bb2e6237e035c8f8ef508e281f1ce075bc6db72 0000000000000000000000000000000000000000 8 8
171 d4a3ed9310e5bd9887e3bf779da5077efab28216 1bb2e6237e035c8f8ef508e281f1ce075bc6db72 12 6
170 d4a3ed9310e5bd9887e3bf779da5077efab28216 1bb2e6237e035c8f8ef508e281f1ce075bc6db72 12 6
172 aee31534993a501858fb6dd96a065671922e7d51 d4a3ed9310e5bd9887e3bf779da5077efab28216 12 4
171 aee31534993a501858fb6dd96a065671922e7d51 d4a3ed9310e5bd9887e3bf779da5077efab28216 12 4
173
172
174 Total: 32 18 (77.8% bigger)
173 Total: 32 18 (77.8% bigger)
175 $ hg debugdatapack $TESTTMP/hgcache/master/packs/*.datapack --node d4a3ed9310e5bd9887e3bf779da5077efab28216
174 $ hg debugdatapack $TESTTMP/hgcache/master/packs/*.datapack --node d4a3ed9310e5bd9887e3bf779da5077efab28216
176 $TESTTMP/hgcache/master/packs/39443fa1064182e93d968b5cba292eb5283260d0:
175 $TESTTMP/hgcache/master/packs/39443fa1064182e93d968b5cba292eb5283260d0:
177
176
178 x
177 x
179 Node Delta Base Delta SHA1 Delta Length
178 Node Delta Base Delta SHA1 Delta Length
180 d4a3ed9310e5bd9887e3bf779da5077efab28216 1bb2e6237e035c8f8ef508e281f1ce075bc6db72 77029ab56e83ea2115dd53ff87483682abe5d7ca 12
179 d4a3ed9310e5bd9887e3bf779da5077efab28216 1bb2e6237e035c8f8ef508e281f1ce075bc6db72 77029ab56e83ea2115dd53ff87483682abe5d7ca 12
181 Node Delta Base Delta SHA1 Delta Length
180 Node Delta Base Delta SHA1 Delta Length
182 1bb2e6237e035c8f8ef508e281f1ce075bc6db72 0000000000000000000000000000000000000000 7ca8c71a64f7b56380e77573da2f7a5fdd2ecdb5 8
181 1bb2e6237e035c8f8ef508e281f1ce075bc6db72 0000000000000000000000000000000000000000 7ca8c71a64f7b56380e77573da2f7a5fdd2ecdb5 8
183 $ hg debughistorypack $TESTTMP/hgcache/master/packs/*.histidx
182 $ hg debughistorypack $TESTTMP/hgcache/master/packs/*.histidx
184
183
185 x
184 x
186 Node P1 Node P2 Node Link Node Copy From
185 Node P1 Node P2 Node Link Node Copy From
187 1bb2e6237e03 d4a3ed9310e5 000000000000 0b03bbc9e1e7
186 1bb2e6237e03 d4a3ed9310e5 000000000000 0b03bbc9e1e7
188 d4a3ed9310e5 aee31534993a 000000000000 421535db10b6
187 d4a3ed9310e5 aee31534993a 000000000000 421535db10b6
189 aee31534993a 1406e7411862 000000000000 a89d614e2364
188 aee31534993a 1406e7411862 000000000000 a89d614e2364
190 1406e7411862 000000000000 000000000000 b292c1e3311f
189 1406e7411862 000000000000 000000000000 b292c1e3311f
191
190
192 # Test copy tracing from a pack
191 # Test copy tracing from a pack
193 $ cd ../master
192 $ cd ../master
194 $ hg mv x y
193 $ hg mv x y
195 $ hg commit -m 'move x to y'
194 $ hg commit -m 'move x to y'
196 $ cd ../shallow
195 $ cd ../shallow
197 $ hg pull -q
196 $ hg pull -q
198 $ hg up -q tip
197 $ hg up -q tip
199 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
198 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
200 $ hg repack
199 $ hg repack
201 $ hg log -f y -T '{desc}\n'
200 $ hg log -f y -T '{desc}\n'
202 move x to y
201 move x to y
203 x4
202 x4
204 x3
203 x3
205 x2
204 x2
206 x
205 x
207
206
208 # Test copy trace across rename and back
207 # Test copy trace across rename and back
209 $ cp -R $TESTTMP/hgcache/master/packs $TESTTMP/backuppacks
208 $ cp -R $TESTTMP/hgcache/master/packs $TESTTMP/backuppacks
210 $ cd ../master
209 $ cd ../master
211 $ hg mv y x
210 $ hg mv y x
212 $ hg commit -m 'move y back to x'
211 $ hg commit -m 'move y back to x'
213 $ hg revert -r 0 x
212 $ hg revert -r 0 x
214 $ mv x y
213 $ mv x y
215 $ hg add y
214 $ hg add y
216 $ echo >> y
215 $ echo >> y
217 $ hg revert x
216 $ hg revert x
218 $ hg commit -m 'add y back without metadata'
217 $ hg commit -m 'add y back without metadata'
219 $ cd ../shallow
218 $ cd ../shallow
220 $ hg pull -q
219 $ hg pull -q
221 $ hg up -q tip
220 $ hg up -q tip
222 2 files fetched over 2 fetches - (2 misses, 0.00% hit ratio) over * (glob)
221 2 files fetched over 2 fetches - (2 misses, 0.00% hit ratio) over * (glob)
223 $ hg repack
222 $ hg repack
224 $ ls $TESTTMP/hgcache/master/packs
223 $ ls $TESTTMP/hgcache/master/packs
225 bfd60adb76018bb952e27cd23fc151bf94865d7d.histidx
224 bfd60adb76018bb952e27cd23fc151bf94865d7d.histidx
226 bfd60adb76018bb952e27cd23fc151bf94865d7d.histpack
225 bfd60adb76018bb952e27cd23fc151bf94865d7d.histpack
227 fb3aa57b22789ebcc45706c352e2d6af099c5816.dataidx
226 fb3aa57b22789ebcc45706c352e2d6af099c5816.dataidx
228 fb3aa57b22789ebcc45706c352e2d6af099c5816.datapack
227 fb3aa57b22789ebcc45706c352e2d6af099c5816.datapack
229 $ hg debughistorypack $TESTTMP/hgcache/master/packs/*.histidx
228 $ hg debughistorypack $TESTTMP/hgcache/master/packs/*.histidx
230
229
231 x
230 x
232 Node P1 Node P2 Node Link Node Copy From
231 Node P1 Node P2 Node Link Node Copy From
233 cd410a44d584 577959738234 000000000000 609547eda446 y
232 cd410a44d584 577959738234 000000000000 609547eda446 y
234 1bb2e6237e03 d4a3ed9310e5 000000000000 0b03bbc9e1e7
233 1bb2e6237e03 d4a3ed9310e5 000000000000 0b03bbc9e1e7
235 d4a3ed9310e5 aee31534993a 000000000000 421535db10b6
234 d4a3ed9310e5 aee31534993a 000000000000 421535db10b6
236 aee31534993a 1406e7411862 000000000000 a89d614e2364
235 aee31534993a 1406e7411862 000000000000 a89d614e2364
237 1406e7411862 000000000000 000000000000 b292c1e3311f
236 1406e7411862 000000000000 000000000000 b292c1e3311f
238
237
239 y
238 y
240 Node P1 Node P2 Node Link Node Copy From
239 Node P1 Node P2 Node Link Node Copy From
241 577959738234 1bb2e6237e03 000000000000 c7faf2fc439a x
240 577959738234 1bb2e6237e03 000000000000 c7faf2fc439a x
242 21f46f2721e7 000000000000 000000000000 d6868642b790
241 21f46f2721e7 000000000000 000000000000 d6868642b790
243 $ hg strip -r '.^'
242 $ hg strip -r '.^'
244 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
243 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
245 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/609547eda446-b26b56a8-backup.hg (glob)
244 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/609547eda446-b26b56a8-backup.hg (glob)
246 $ hg -R ../master strip -r '.^'
245 $ hg -R ../master strip -r '.^'
247 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
246 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
248 saved backup bundle to $TESTTMP/master/.hg/strip-backup/609547eda446-b26b56a8-backup.hg (glob)
247 saved backup bundle to $TESTTMP/master/.hg/strip-backup/609547eda446-b26b56a8-backup.hg (glob)
249
248
250 $ rm -rf $TESTTMP/hgcache/master/packs
249 $ rm -rf $TESTTMP/hgcache/master/packs
251 $ cp -R $TESTTMP/backuppacks $TESTTMP/hgcache/master/packs
250 $ cp -R $TESTTMP/backuppacks $TESTTMP/hgcache/master/packs
252
251
253 # Test repacking datapack without history
252 # Test repacking datapack without history
254 $ rm -rf $CACHEDIR/master/packs/*hist*
253 $ rm -rf $CACHEDIR/master/packs/*hist*
255 $ hg repack
254 $ hg repack
256 $ hg debugdatapack $TESTTMP/hgcache/master/packs/*.datapack
255 $ hg debugdatapack $TESTTMP/hgcache/master/packs/*.datapack
257 $TESTTMP/hgcache/master/packs/922aca43dbbeda4d250565372e8892ec7b08da6a:
256 $TESTTMP/hgcache/master/packs/922aca43dbbeda4d250565372e8892ec7b08da6a:
258 x:
257 x:
259 Node Delta Base Delta Length Blob Size
258 Node Delta Base Delta Length Blob Size
260 1bb2e6237e03 000000000000 8 8
259 1bb2e6237e03 000000000000 8 8
261 d4a3ed9310e5 1bb2e6237e03 12 6
260 d4a3ed9310e5 1bb2e6237e03 12 6
262 aee31534993a d4a3ed9310e5 12 4
261 aee31534993a d4a3ed9310e5 12 4
263
262
264 Total: 32 18 (77.8% bigger)
263 Total: 32 18 (77.8% bigger)
265 y:
264 y:
266 Node Delta Base Delta Length Blob Size
265 Node Delta Base Delta Length Blob Size
267 577959738234 000000000000 70 8
266 577959738234 000000000000 70 8
268
267
269 Total: 70 8 (775.0% bigger)
268 Total: 70 8 (775.0% bigger)
270
269
271 $ hg cat -r ".^" x
270 $ hg cat -r ".^" x
272 x
271 x
273 x
272 x
274 x
273 x
275 x
274 x
276
275
277 Incremental repack
276 Incremental repack
278 $ rm -rf $CACHEDIR/master/packs/*
277 $ rm -rf $CACHEDIR/master/packs/*
279 $ cat >> .hg/hgrc <<EOF
278 $ cat >> .hg/hgrc <<EOF
280 > [remotefilelog]
279 > [remotefilelog]
281 > data.generations=60
280 > data.generations=60
282 > 150
281 > 150
283 > EOF
282 > EOF
284
283
285 Single pack - repack does nothing
284 Single pack - repack does nothing
286 $ hg prefetch -r 0
285 $ hg prefetch -r 0
287 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
286 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
288 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
287 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
289 [1]
288 [1]
290 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
289 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
291 [1]
290 [1]
292 $ hg repack --incremental
291 $ hg repack --incremental
293 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
292 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
294 -r--r--r-- 70 052643fdcdebbd42d7c180a651a30d46098e6fe1.datapack
293 -r--r--r-- 70 052643fdcdebbd42d7c180a651a30d46098e6fe1.datapack
295 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
294 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
296 -r--r--r-- 90 955a622173324b2d8b53e1147f209f1cf125302e.histpack
295 -r--r--r-- 90 955a622173324b2d8b53e1147f209f1cf125302e.histpack
297
296
298 3 gen1 packs, 1 gen0 pack - packs 3 gen1 into 1
297 3 gen1 packs, 1 gen0 pack - packs 3 gen1 into 1
299 $ hg prefetch -r 1
298 $ hg prefetch -r 1
300 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
299 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
301 $ hg prefetch -r 2
300 $ hg prefetch -r 2
302 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
301 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
303 $ hg prefetch -r 3
302 $ hg prefetch -r 3
304 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
303 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
305 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
304 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
306 -r--r--r-- 70 052643fdcdebbd42d7c180a651a30d46098e6fe1.datapack
305 -r--r--r-- 70 052643fdcdebbd42d7c180a651a30d46098e6fe1.datapack
307 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
306 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
308 -r--r--r-- 90 955a622173324b2d8b53e1147f209f1cf125302e.histpack
307 -r--r--r-- 90 955a622173324b2d8b53e1147f209f1cf125302e.histpack
309 $ hg repack --incremental
308 $ hg repack --incremental
310 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
309 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
311 -r--r--r-- 70 052643fdcdebbd42d7c180a651a30d46098e6fe1.datapack
310 -r--r--r-- 70 052643fdcdebbd42d7c180a651a30d46098e6fe1.datapack
312 -r--r--r-- 226 39443fa1064182e93d968b5cba292eb5283260d0.datapack
311 -r--r--r-- 226 39443fa1064182e93d968b5cba292eb5283260d0.datapack
313 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
312 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
314 -r--r--r-- 336 604552d403a1381749faf656feca0ca265a6d52c.histpack
313 -r--r--r-- 336 604552d403a1381749faf656feca0ca265a6d52c.histpack
315 -r--r--r-- 90 955a622173324b2d8b53e1147f209f1cf125302e.histpack
314 -r--r--r-- 90 955a622173324b2d8b53e1147f209f1cf125302e.histpack
316
315
317 1 gen3 pack, 1 gen0 pack - does nothing
316 1 gen3 pack, 1 gen0 pack - does nothing
318 $ hg repack --incremental
317 $ hg repack --incremental
319 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
318 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
320 -r--r--r-- 70 052643fdcdebbd42d7c180a651a30d46098e6fe1.datapack
319 -r--r--r-- 70 052643fdcdebbd42d7c180a651a30d46098e6fe1.datapack
321 -r--r--r-- 226 39443fa1064182e93d968b5cba292eb5283260d0.datapack
320 -r--r--r-- 226 39443fa1064182e93d968b5cba292eb5283260d0.datapack
322 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
321 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
323 -r--r--r-- 336 604552d403a1381749faf656feca0ca265a6d52c.histpack
322 -r--r--r-- 336 604552d403a1381749faf656feca0ca265a6d52c.histpack
324 -r--r--r-- 90 955a622173324b2d8b53e1147f209f1cf125302e.histpack
323 -r--r--r-- 90 955a622173324b2d8b53e1147f209f1cf125302e.histpack
325
324
326 Pull should run background repack
325 Pull should run background repack
327 $ cat >> .hg/hgrc <<EOF
326 $ cat >> .hg/hgrc <<EOF
328 > [remotefilelog]
327 > [remotefilelog]
329 > backgroundrepack=True
328 > backgroundrepack=True
330 > EOF
329 > EOF
331 $ clearcache
330 $ clearcache
332 $ hg prefetch -r 0
331 $ hg prefetch -r 0
333 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
332 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
334 $ hg prefetch -r 1
333 $ hg prefetch -r 1
335 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
334 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
336 $ hg prefetch -r 2
335 $ hg prefetch -r 2
337 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
336 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
338 $ hg prefetch -r 3
337 $ hg prefetch -r 3
339 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
338 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
340
339
341 $ hg pull
340 $ hg pull
342 pulling from ssh://user@dummy/master
341 pulling from ssh://user@dummy/master
343 searching for changes
342 searching for changes
344 no changes found
343 no changes found
345 (running background incremental repack)
344 (running background incremental repack)
346 $ sleep 0.5
347 $ hg debugwaitonrepack >/dev/null 2>&1
345 $ hg debugwaitonrepack >/dev/null 2>&1
348 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
346 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
349 -r--r--r-- 303 156a6c1c83aeb69422d7936e0a46ba9bc06a71c0.datapack
347 -r--r--r-- 303 156a6c1c83aeb69422d7936e0a46ba9bc06a71c0.datapack
350 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
348 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
351 -r--r--r-- 336 604552d403a1381749faf656feca0ca265a6d52c.histpack
349 -r--r--r-- 336 604552d403a1381749faf656feca0ca265a6d52c.histpack
352
350
353 Test environment variable resolution
351 Test environment variable resolution
354 $ CACHEPATH=$TESTTMP/envcache hg prefetch --config 'remotefilelog.cachepath=$CACHEPATH'
352 $ CACHEPATH=$TESTTMP/envcache hg prefetch --config 'remotefilelog.cachepath=$CACHEPATH'
355 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
353 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
356 $ find $TESTTMP/envcache | sort
354 $ find $TESTTMP/envcache | sort
357 $TESTTMP/envcache
355 $TESTTMP/envcache
358 $TESTTMP/envcache/master
356 $TESTTMP/envcache/master
359 $TESTTMP/envcache/master/95
357 $TESTTMP/envcache/master/95
360 $TESTTMP/envcache/master/95/cb0bfd2977c761298d9624e4b4d4c72a39974a
358 $TESTTMP/envcache/master/95/cb0bfd2977c761298d9624e4b4d4c72a39974a
361 $TESTTMP/envcache/master/95/cb0bfd2977c761298d9624e4b4d4c72a39974a/577959738234a1eb241ed3ed4b22a575833f56e0
359 $TESTTMP/envcache/master/95/cb0bfd2977c761298d9624e4b4d4c72a39974a/577959738234a1eb241ed3ed4b22a575833f56e0
362 $TESTTMP/envcache/repos
360 $TESTTMP/envcache/repos
363
361
364 Test local remotefilelog blob is correct when based on a pack
362 Test local remotefilelog blob is correct when based on a pack
365 $ hg prefetch -r .
363 $ hg prefetch -r .
366 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
364 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
367 $ echo >> y
365 $ echo >> y
368 $ hg commit -m y2
366 $ hg commit -m y2
369 $ hg debugremotefilelog .hg/store/data/95cb0bfd2977c761298d9624e4b4d4c72a39974a/b70860edba4f8242a1d52f2a94679dd23cb76808
367 $ hg debugremotefilelog .hg/store/data/95cb0bfd2977c761298d9624e4b4d4c72a39974a/b70860edba4f8242a1d52f2a94679dd23cb76808
370 size: 9 bytes
368 size: 9 bytes
371 path: .hg/store/data/95cb0bfd2977c761298d9624e4b4d4c72a39974a/b70860edba4f8242a1d52f2a94679dd23cb76808
369 path: .hg/store/data/95cb0bfd2977c761298d9624e4b4d4c72a39974a/b70860edba4f8242a1d52f2a94679dd23cb76808
372 key: b70860edba4f
370 key: b70860edba4f
373
371
374 node => p1 p2 linknode copyfrom
372 node => p1 p2 linknode copyfrom
375 b70860edba4f => 577959738234 000000000000 08d3fbc98c48
373 b70860edba4f => 577959738234 000000000000 08d3fbc98c48
376 577959738234 => 1bb2e6237e03 000000000000 c7faf2fc439a x
374 577959738234 => 1bb2e6237e03 000000000000 c7faf2fc439a x
377 1bb2e6237e03 => d4a3ed9310e5 000000000000 0b03bbc9e1e7
375 1bb2e6237e03 => d4a3ed9310e5 000000000000 0b03bbc9e1e7
378 d4a3ed9310e5 => aee31534993a 000000000000 421535db10b6
376 d4a3ed9310e5 => aee31534993a 000000000000 421535db10b6
379 aee31534993a => 1406e7411862 000000000000 a89d614e2364
377 aee31534993a => 1406e7411862 000000000000 a89d614e2364
380 1406e7411862 => 000000000000 000000000000 b292c1e3311f
378 1406e7411862 => 000000000000 000000000000 b292c1e3311f
@@ -1,460 +1,458 b''
1 #require no-windows
1 #require no-windows
2
2
3 $ . "$TESTDIR/remotefilelog-library.sh"
3 $ . "$TESTDIR/remotefilelog-library.sh"
4 # devel.remotefilelog.ensurestart: reduce race condition with
4 # devel.remotefilelog.ensurestart: reduce race condition with
5 # waiton{repack/prefetch}
5 # waiton{repack/prefetch}
6 $ cat >> $HGRCPATH <<EOF
6 $ cat >> $HGRCPATH <<EOF
7 > [devel]
7 > [devel]
8 > remotefilelog.ensurestart=True
8 > remotefilelog.ensurestart=True
9 > remotefilelog.bg-wait=True
9 > remotefilelog.bg-wait=True
10 > EOF
10 > EOF
11
11
12 $ hg init master
12 $ hg init master
13 $ cd master
13 $ cd master
14 $ cat >> .hg/hgrc <<EOF
14 $ cat >> .hg/hgrc <<EOF
15 > [remotefilelog]
15 > [remotefilelog]
16 > server=True
16 > server=True
17 > serverexpiration=-1
17 > serverexpiration=-1
18 > EOF
18 > EOF
19 $ echo x > x
19 $ echo x > x
20 $ hg commit -qAm x
20 $ hg commit -qAm x
21 $ echo x >> x
21 $ echo x >> x
22 $ hg commit -qAm x2
22 $ hg commit -qAm x2
23 $ cd ..
23 $ cd ..
24
24
25 $ hgcloneshallow ssh://user@dummy/master shallow -q
25 $ hgcloneshallow ssh://user@dummy/master shallow -q
26 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
26 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
27
27
28 # Set the prefetchdays config to zero so that all commits are prefetched
28 # Set the prefetchdays config to zero so that all commits are prefetched
29 # no matter what their creation date is.
29 # no matter what their creation date is.
30 $ cd shallow
30 $ cd shallow
31 $ cat >> .hg/hgrc <<EOF
31 $ cat >> .hg/hgrc <<EOF
32 > [remotefilelog]
32 > [remotefilelog]
33 > prefetchdays=0
33 > prefetchdays=0
34 > EOF
34 > EOF
35 $ cd ..
35 $ cd ..
36
36
37 # Test that repack cleans up the old files and creates new packs
37 # Test that repack cleans up the old files and creates new packs
38
38
39 $ cd shallow
39 $ cd shallow
40 $ find $CACHEDIR | sort
40 $ find $CACHEDIR | sort
41 $TESTTMP/hgcache
41 $TESTTMP/hgcache
42 $TESTTMP/hgcache/master
42 $TESTTMP/hgcache/master
43 $TESTTMP/hgcache/master/11
43 $TESTTMP/hgcache/master/11
44 $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072
44 $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072
45 $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/aee31534993a501858fb6dd96a065671922e7d51
45 $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/aee31534993a501858fb6dd96a065671922e7d51
46 $TESTTMP/hgcache/repos
46 $TESTTMP/hgcache/repos
47
47
48 $ hg repack
48 $ hg repack
49
49
50 $ find $CACHEDIR | sort
50 $ find $CACHEDIR | sort
51 $TESTTMP/hgcache
51 $TESTTMP/hgcache
52 $TESTTMP/hgcache/master
52 $TESTTMP/hgcache/master
53 $TESTTMP/hgcache/master/packs
53 $TESTTMP/hgcache/master/packs
54 $TESTTMP/hgcache/master/packs/1e91b207daf5d7b48f1be9c587d6b5ae654ce78c.histidx
54 $TESTTMP/hgcache/master/packs/1e91b207daf5d7b48f1be9c587d6b5ae654ce78c.histidx
55 $TESTTMP/hgcache/master/packs/1e91b207daf5d7b48f1be9c587d6b5ae654ce78c.histpack
55 $TESTTMP/hgcache/master/packs/1e91b207daf5d7b48f1be9c587d6b5ae654ce78c.histpack
56 $TESTTMP/hgcache/master/packs/b1e0cfc7f345e408a7825e3081501959488d59ce.dataidx
56 $TESTTMP/hgcache/master/packs/b1e0cfc7f345e408a7825e3081501959488d59ce.dataidx
57 $TESTTMP/hgcache/master/packs/b1e0cfc7f345e408a7825e3081501959488d59ce.datapack
57 $TESTTMP/hgcache/master/packs/b1e0cfc7f345e408a7825e3081501959488d59ce.datapack
58 $TESTTMP/hgcache/repos
58 $TESTTMP/hgcache/repos
59
59
60 # Test that the packs are readonly
60 # Test that the packs are readonly
61 $ ls_l $CACHEDIR/master/packs
61 $ ls_l $CACHEDIR/master/packs
62 -r--r--r-- 1145 1e91b207daf5d7b48f1be9c587d6b5ae654ce78c.histidx
62 -r--r--r-- 1145 1e91b207daf5d7b48f1be9c587d6b5ae654ce78c.histidx
63 -r--r--r-- 172 1e91b207daf5d7b48f1be9c587d6b5ae654ce78c.histpack
63 -r--r--r-- 172 1e91b207daf5d7b48f1be9c587d6b5ae654ce78c.histpack
64 -r--r--r-- 1074 b1e0cfc7f345e408a7825e3081501959488d59ce.dataidx
64 -r--r--r-- 1074 b1e0cfc7f345e408a7825e3081501959488d59ce.dataidx
65 -r--r--r-- 72 b1e0cfc7f345e408a7825e3081501959488d59ce.datapack
65 -r--r--r-- 72 b1e0cfc7f345e408a7825e3081501959488d59ce.datapack
66
66
67 # Test that the data in the new packs is accessible
67 # Test that the data in the new packs is accessible
68 $ hg cat -r . x
68 $ hg cat -r . x
69 x
69 x
70 x
70 x
71
71
72 # Test that adding new data and repacking it results in the loose data and the
72 # Test that adding new data and repacking it results in the loose data and the
73 # old packs being combined.
73 # old packs being combined.
74
74
75 $ cd ../master
75 $ cd ../master
76 $ echo x >> x
76 $ echo x >> x
77 $ hg commit -m x3
77 $ hg commit -m x3
78 $ cd ../shallow
78 $ cd ../shallow
79 $ hg pull -q
79 $ hg pull -q
80 $ hg up -q tip
80 $ hg up -q tip
81 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
81 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
82
82
83 $ find $CACHEDIR -type f | sort
83 $ find $CACHEDIR -type f | sort
84 $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/d4a3ed9310e5bd9887e3bf779da5077efab28216
84 $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/d4a3ed9310e5bd9887e3bf779da5077efab28216
85 $TESTTMP/hgcache/master/packs/1e91b207daf5d7b48f1be9c587d6b5ae654ce78c.histidx
85 $TESTTMP/hgcache/master/packs/1e91b207daf5d7b48f1be9c587d6b5ae654ce78c.histidx
86 $TESTTMP/hgcache/master/packs/1e91b207daf5d7b48f1be9c587d6b5ae654ce78c.histpack
86 $TESTTMP/hgcache/master/packs/1e91b207daf5d7b48f1be9c587d6b5ae654ce78c.histpack
87 $TESTTMP/hgcache/master/packs/b1e0cfc7f345e408a7825e3081501959488d59ce.dataidx
87 $TESTTMP/hgcache/master/packs/b1e0cfc7f345e408a7825e3081501959488d59ce.dataidx
88 $TESTTMP/hgcache/master/packs/b1e0cfc7f345e408a7825e3081501959488d59ce.datapack
88 $TESTTMP/hgcache/master/packs/b1e0cfc7f345e408a7825e3081501959488d59ce.datapack
89 $TESTTMP/hgcache/repos
89 $TESTTMP/hgcache/repos
90
90
91 # First assert that with --packsonly, the loose object will be ignored:
91 # First assert that with --packsonly, the loose object will be ignored:
92
92
93 $ hg repack --packsonly
93 $ hg repack --packsonly
94
94
95 $ find $CACHEDIR -type f | sort
95 $ find $CACHEDIR -type f | sort
96 $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/d4a3ed9310e5bd9887e3bf779da5077efab28216
96 $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/d4a3ed9310e5bd9887e3bf779da5077efab28216
97 $TESTTMP/hgcache/master/packs/1e91b207daf5d7b48f1be9c587d6b5ae654ce78c.histidx
97 $TESTTMP/hgcache/master/packs/1e91b207daf5d7b48f1be9c587d6b5ae654ce78c.histidx
98 $TESTTMP/hgcache/master/packs/1e91b207daf5d7b48f1be9c587d6b5ae654ce78c.histpack
98 $TESTTMP/hgcache/master/packs/1e91b207daf5d7b48f1be9c587d6b5ae654ce78c.histpack
99 $TESTTMP/hgcache/master/packs/b1e0cfc7f345e408a7825e3081501959488d59ce.dataidx
99 $TESTTMP/hgcache/master/packs/b1e0cfc7f345e408a7825e3081501959488d59ce.dataidx
100 $TESTTMP/hgcache/master/packs/b1e0cfc7f345e408a7825e3081501959488d59ce.datapack
100 $TESTTMP/hgcache/master/packs/b1e0cfc7f345e408a7825e3081501959488d59ce.datapack
101 $TESTTMP/hgcache/repos
101 $TESTTMP/hgcache/repos
102
102
103 $ hg repack --traceback
103 $ hg repack --traceback
104
104
105 $ find $CACHEDIR -type f | sort
105 $ find $CACHEDIR -type f | sort
106 $TESTTMP/hgcache/master/packs/78840d69389c7404327f7477e3931c89945c37d1.dataidx
106 $TESTTMP/hgcache/master/packs/78840d69389c7404327f7477e3931c89945c37d1.dataidx
107 $TESTTMP/hgcache/master/packs/78840d69389c7404327f7477e3931c89945c37d1.datapack
107 $TESTTMP/hgcache/master/packs/78840d69389c7404327f7477e3931c89945c37d1.datapack
108 $TESTTMP/hgcache/master/packs/8abe7889aae389337d12ebe6085d4ee13854c7c9.histidx
108 $TESTTMP/hgcache/master/packs/8abe7889aae389337d12ebe6085d4ee13854c7c9.histidx
109 $TESTTMP/hgcache/master/packs/8abe7889aae389337d12ebe6085d4ee13854c7c9.histpack
109 $TESTTMP/hgcache/master/packs/8abe7889aae389337d12ebe6085d4ee13854c7c9.histpack
110 $TESTTMP/hgcache/repos
110 $TESTTMP/hgcache/repos
111
111
112 # Verify all the file data is still available
112 # Verify all the file data is still available
113 $ hg cat -r . x
113 $ hg cat -r . x
114 x
114 x
115 x
115 x
116 x
116 x
117 $ hg cat -r '.^' x
117 $ hg cat -r '.^' x
118 x
118 x
119 x
119 x
120
120
121 # Test that repacking again without new data does not delete the pack files
121 # Test that repacking again without new data does not delete the pack files
122 # and did not change the pack names
122 # and did not change the pack names
123 $ hg repack
123 $ hg repack
124 $ find $CACHEDIR -type f | sort
124 $ find $CACHEDIR -type f | sort
125 $TESTTMP/hgcache/master/packs/78840d69389c7404327f7477e3931c89945c37d1.dataidx
125 $TESTTMP/hgcache/master/packs/78840d69389c7404327f7477e3931c89945c37d1.dataidx
126 $TESTTMP/hgcache/master/packs/78840d69389c7404327f7477e3931c89945c37d1.datapack
126 $TESTTMP/hgcache/master/packs/78840d69389c7404327f7477e3931c89945c37d1.datapack
127 $TESTTMP/hgcache/master/packs/8abe7889aae389337d12ebe6085d4ee13854c7c9.histidx
127 $TESTTMP/hgcache/master/packs/8abe7889aae389337d12ebe6085d4ee13854c7c9.histidx
128 $TESTTMP/hgcache/master/packs/8abe7889aae389337d12ebe6085d4ee13854c7c9.histpack
128 $TESTTMP/hgcache/master/packs/8abe7889aae389337d12ebe6085d4ee13854c7c9.histpack
129 $TESTTMP/hgcache/repos
129 $TESTTMP/hgcache/repos
130
130
131 # Run two repacks at once
131 # Run two repacks at once
132 $ hg repack --config "hooks.prerepack=sleep 3" &
132 $ hg repack --config "hooks.prerepack=sleep 3" &
133 $ sleep 1
133 $ sleep 1
134 $ hg repack
134 $ hg repack
135 skipping repack - another repack is already running
135 skipping repack - another repack is already running
136 $ hg debugwaitonrepack >/dev/null 2>&1
136 $ hg debugwaitonrepack >/dev/null 2>&1
137
137
138 # Run repack in the background
138 # Run repack in the background
139 $ cd ../master
139 $ cd ../master
140 $ echo x >> x
140 $ echo x >> x
141 $ hg commit -m x4
141 $ hg commit -m x4
142 $ cd ../shallow
142 $ cd ../shallow
143 $ hg pull -q
143 $ hg pull -q
144 $ hg up -q tip
144 $ hg up -q tip
145 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
145 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
146 $ find $CACHEDIR -type f | sort
146 $ find $CACHEDIR -type f | sort
147 $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1bb2e6237e035c8f8ef508e281f1ce075bc6db72
147 $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1bb2e6237e035c8f8ef508e281f1ce075bc6db72
148 $TESTTMP/hgcache/master/packs/78840d69389c7404327f7477e3931c89945c37d1.dataidx
148 $TESTTMP/hgcache/master/packs/78840d69389c7404327f7477e3931c89945c37d1.dataidx
149 $TESTTMP/hgcache/master/packs/78840d69389c7404327f7477e3931c89945c37d1.datapack
149 $TESTTMP/hgcache/master/packs/78840d69389c7404327f7477e3931c89945c37d1.datapack
150 $TESTTMP/hgcache/master/packs/8abe7889aae389337d12ebe6085d4ee13854c7c9.histidx
150 $TESTTMP/hgcache/master/packs/8abe7889aae389337d12ebe6085d4ee13854c7c9.histidx
151 $TESTTMP/hgcache/master/packs/8abe7889aae389337d12ebe6085d4ee13854c7c9.histpack
151 $TESTTMP/hgcache/master/packs/8abe7889aae389337d12ebe6085d4ee13854c7c9.histpack
152 $TESTTMP/hgcache/repos
152 $TESTTMP/hgcache/repos
153
153
154 $ hg repack --background
154 $ hg repack --background
155 (running background repack)
155 (running background repack)
156 $ sleep 0.5
157 $ hg debugwaitonrepack >/dev/null 2>&1
156 $ hg debugwaitonrepack >/dev/null 2>&1
158 $ find $CACHEDIR -type f | sort
157 $ find $CACHEDIR -type f | sort
159 $TESTTMP/hgcache/master/packs/39443fa1064182e93d968b5cba292eb5283260d0.dataidx
158 $TESTTMP/hgcache/master/packs/39443fa1064182e93d968b5cba292eb5283260d0.dataidx
160 $TESTTMP/hgcache/master/packs/39443fa1064182e93d968b5cba292eb5283260d0.datapack
159 $TESTTMP/hgcache/master/packs/39443fa1064182e93d968b5cba292eb5283260d0.datapack
161 $TESTTMP/hgcache/master/packs/604552d403a1381749faf656feca0ca265a6d52c.histidx
160 $TESTTMP/hgcache/master/packs/604552d403a1381749faf656feca0ca265a6d52c.histidx
162 $TESTTMP/hgcache/master/packs/604552d403a1381749faf656feca0ca265a6d52c.histpack
161 $TESTTMP/hgcache/master/packs/604552d403a1381749faf656feca0ca265a6d52c.histpack
163 $TESTTMP/hgcache/repos
162 $TESTTMP/hgcache/repos
164
163
165 # Test debug commands
164 # Test debug commands
166
165
167 $ hg debugdatapack $TESTTMP/hgcache/master/packs/*.datapack
166 $ hg debugdatapack $TESTTMP/hgcache/master/packs/*.datapack
168 $TESTTMP/hgcache/master/packs/39443fa1064182e93d968b5cba292eb5283260d0:
167 $TESTTMP/hgcache/master/packs/39443fa1064182e93d968b5cba292eb5283260d0:
169 x:
168 x:
170 Node Delta Base Delta Length Blob Size
169 Node Delta Base Delta Length Blob Size
171 1bb2e6237e03 000000000000 8 8
170 1bb2e6237e03 000000000000 8 8
172 d4a3ed9310e5 1bb2e6237e03 12 6
171 d4a3ed9310e5 1bb2e6237e03 12 6
173 aee31534993a d4a3ed9310e5 12 4
172 aee31534993a d4a3ed9310e5 12 4
174
173
175 Total: 32 18 (77.8% bigger)
174 Total: 32 18 (77.8% bigger)
176 $ hg debugdatapack --long $TESTTMP/hgcache/master/packs/*.datapack
175 $ hg debugdatapack --long $TESTTMP/hgcache/master/packs/*.datapack
177 $TESTTMP/hgcache/master/packs/39443fa1064182e93d968b5cba292eb5283260d0:
176 $TESTTMP/hgcache/master/packs/39443fa1064182e93d968b5cba292eb5283260d0:
178 x:
177 x:
179 Node Delta Base Delta Length Blob Size
178 Node Delta Base Delta Length Blob Size
180 1bb2e6237e035c8f8ef508e281f1ce075bc6db72 0000000000000000000000000000000000000000 8 8
179 1bb2e6237e035c8f8ef508e281f1ce075bc6db72 0000000000000000000000000000000000000000 8 8
181 d4a3ed9310e5bd9887e3bf779da5077efab28216 1bb2e6237e035c8f8ef508e281f1ce075bc6db72 12 6
180 d4a3ed9310e5bd9887e3bf779da5077efab28216 1bb2e6237e035c8f8ef508e281f1ce075bc6db72 12 6
182 aee31534993a501858fb6dd96a065671922e7d51 d4a3ed9310e5bd9887e3bf779da5077efab28216 12 4
181 aee31534993a501858fb6dd96a065671922e7d51 d4a3ed9310e5bd9887e3bf779da5077efab28216 12 4
183
182
184 Total: 32 18 (77.8% bigger)
183 Total: 32 18 (77.8% bigger)
185 $ hg debugdatapack $TESTTMP/hgcache/master/packs/*.datapack --node d4a3ed9310e5bd9887e3bf779da5077efab28216
184 $ hg debugdatapack $TESTTMP/hgcache/master/packs/*.datapack --node d4a3ed9310e5bd9887e3bf779da5077efab28216
186 $TESTTMP/hgcache/master/packs/39443fa1064182e93d968b5cba292eb5283260d0:
185 $TESTTMP/hgcache/master/packs/39443fa1064182e93d968b5cba292eb5283260d0:
187
186
188 x
187 x
189 Node Delta Base Delta SHA1 Delta Length
188 Node Delta Base Delta SHA1 Delta Length
190 d4a3ed9310e5bd9887e3bf779da5077efab28216 1bb2e6237e035c8f8ef508e281f1ce075bc6db72 77029ab56e83ea2115dd53ff87483682abe5d7ca 12
189 d4a3ed9310e5bd9887e3bf779da5077efab28216 1bb2e6237e035c8f8ef508e281f1ce075bc6db72 77029ab56e83ea2115dd53ff87483682abe5d7ca 12
191 Node Delta Base Delta SHA1 Delta Length
190 Node Delta Base Delta SHA1 Delta Length
192 1bb2e6237e035c8f8ef508e281f1ce075bc6db72 0000000000000000000000000000000000000000 7ca8c71a64f7b56380e77573da2f7a5fdd2ecdb5 8
191 1bb2e6237e035c8f8ef508e281f1ce075bc6db72 0000000000000000000000000000000000000000 7ca8c71a64f7b56380e77573da2f7a5fdd2ecdb5 8
193 $ hg debughistorypack $TESTTMP/hgcache/master/packs/*.histidx
192 $ hg debughistorypack $TESTTMP/hgcache/master/packs/*.histidx
194
193
195 x
194 x
196 Node P1 Node P2 Node Link Node Copy From
195 Node P1 Node P2 Node Link Node Copy From
197 1bb2e6237e03 d4a3ed9310e5 000000000000 0b03bbc9e1e7
196 1bb2e6237e03 d4a3ed9310e5 000000000000 0b03bbc9e1e7
198 d4a3ed9310e5 aee31534993a 000000000000 421535db10b6
197 d4a3ed9310e5 aee31534993a 000000000000 421535db10b6
199 aee31534993a 1406e7411862 000000000000 a89d614e2364
198 aee31534993a 1406e7411862 000000000000 a89d614e2364
200 1406e7411862 000000000000 000000000000 b292c1e3311f
199 1406e7411862 000000000000 000000000000 b292c1e3311f
201
200
202 # Test copy tracing from a pack
201 # Test copy tracing from a pack
203 $ cd ../master
202 $ cd ../master
204 $ hg mv x y
203 $ hg mv x y
205 $ hg commit -m 'move x to y'
204 $ hg commit -m 'move x to y'
206 $ cd ../shallow
205 $ cd ../shallow
207 $ hg pull -q
206 $ hg pull -q
208 $ hg up -q tip
207 $ hg up -q tip
209 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
208 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
210 $ hg repack
209 $ hg repack
211 $ hg log -f y -T '{desc}\n'
210 $ hg log -f y -T '{desc}\n'
212 move x to y
211 move x to y
213 x4
212 x4
214 x3
213 x3
215 x2
214 x2
216 x
215 x
217
216
218 # Test copy trace across rename and back
217 # Test copy trace across rename and back
219 $ cp -R $TESTTMP/hgcache/master/packs $TESTTMP/backuppacks
218 $ cp -R $TESTTMP/hgcache/master/packs $TESTTMP/backuppacks
220 $ cd ../master
219 $ cd ../master
221 $ hg mv y x
220 $ hg mv y x
222 $ hg commit -m 'move y back to x'
221 $ hg commit -m 'move y back to x'
223 $ hg revert -r 0 x
222 $ hg revert -r 0 x
224 $ mv x y
223 $ mv x y
225 $ hg add y
224 $ hg add y
226 $ echo >> y
225 $ echo >> y
227 $ hg revert x
226 $ hg revert x
228 $ hg commit -m 'add y back without metadata'
227 $ hg commit -m 'add y back without metadata'
229 $ cd ../shallow
228 $ cd ../shallow
230 $ hg pull -q
229 $ hg pull -q
231 $ hg up -q tip
230 $ hg up -q tip
232 2 files fetched over 2 fetches - (2 misses, 0.00% hit ratio) over * (glob)
231 2 files fetched over 2 fetches - (2 misses, 0.00% hit ratio) over * (glob)
233 $ hg repack
232 $ hg repack
234 $ ls $TESTTMP/hgcache/master/packs
233 $ ls $TESTTMP/hgcache/master/packs
235 bfd60adb76018bb952e27cd23fc151bf94865d7d.histidx
234 bfd60adb76018bb952e27cd23fc151bf94865d7d.histidx
236 bfd60adb76018bb952e27cd23fc151bf94865d7d.histpack
235 bfd60adb76018bb952e27cd23fc151bf94865d7d.histpack
237 fb3aa57b22789ebcc45706c352e2d6af099c5816.dataidx
236 fb3aa57b22789ebcc45706c352e2d6af099c5816.dataidx
238 fb3aa57b22789ebcc45706c352e2d6af099c5816.datapack
237 fb3aa57b22789ebcc45706c352e2d6af099c5816.datapack
239 $ hg debughistorypack $TESTTMP/hgcache/master/packs/*.histidx
238 $ hg debughistorypack $TESTTMP/hgcache/master/packs/*.histidx
240
239
241 x
240 x
242 Node P1 Node P2 Node Link Node Copy From
241 Node P1 Node P2 Node Link Node Copy From
243 cd410a44d584 577959738234 000000000000 609547eda446 y
242 cd410a44d584 577959738234 000000000000 609547eda446 y
244 1bb2e6237e03 d4a3ed9310e5 000000000000 0b03bbc9e1e7
243 1bb2e6237e03 d4a3ed9310e5 000000000000 0b03bbc9e1e7
245 d4a3ed9310e5 aee31534993a 000000000000 421535db10b6
244 d4a3ed9310e5 aee31534993a 000000000000 421535db10b6
246 aee31534993a 1406e7411862 000000000000 a89d614e2364
245 aee31534993a 1406e7411862 000000000000 a89d614e2364
247 1406e7411862 000000000000 000000000000 b292c1e3311f
246 1406e7411862 000000000000 000000000000 b292c1e3311f
248
247
249 y
248 y
250 Node P1 Node P2 Node Link Node Copy From
249 Node P1 Node P2 Node Link Node Copy From
251 577959738234 1bb2e6237e03 000000000000 c7faf2fc439a x
250 577959738234 1bb2e6237e03 000000000000 c7faf2fc439a x
252 21f46f2721e7 000000000000 000000000000 d6868642b790
251 21f46f2721e7 000000000000 000000000000 d6868642b790
253 $ hg strip -r '.^'
252 $ hg strip -r '.^'
254 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
253 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
255 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/609547eda446-b26b56a8-backup.hg (glob)
254 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/609547eda446-b26b56a8-backup.hg (glob)
256 $ hg -R ../master strip -r '.^'
255 $ hg -R ../master strip -r '.^'
257 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
256 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
258 saved backup bundle to $TESTTMP/master/.hg/strip-backup/609547eda446-b26b56a8-backup.hg (glob)
257 saved backup bundle to $TESTTMP/master/.hg/strip-backup/609547eda446-b26b56a8-backup.hg (glob)
259
258
260 $ rm -rf $TESTTMP/hgcache/master/packs
259 $ rm -rf $TESTTMP/hgcache/master/packs
261 $ cp -R $TESTTMP/backuppacks $TESTTMP/hgcache/master/packs
260 $ cp -R $TESTTMP/backuppacks $TESTTMP/hgcache/master/packs
262
261
263 # Test repacking datapack without history
262 # Test repacking datapack without history
264 $ rm -rf $CACHEDIR/master/packs/*hist*
263 $ rm -rf $CACHEDIR/master/packs/*hist*
265 $ hg repack
264 $ hg repack
266 $ hg debugdatapack $TESTTMP/hgcache/master/packs/*.datapack
265 $ hg debugdatapack $TESTTMP/hgcache/master/packs/*.datapack
267 $TESTTMP/hgcache/master/packs/922aca43dbbeda4d250565372e8892ec7b08da6a:
266 $TESTTMP/hgcache/master/packs/922aca43dbbeda4d250565372e8892ec7b08da6a:
268 x:
267 x:
269 Node Delta Base Delta Length Blob Size
268 Node Delta Base Delta Length Blob Size
270 1bb2e6237e03 000000000000 8 8
269 1bb2e6237e03 000000000000 8 8
271 d4a3ed9310e5 1bb2e6237e03 12 6
270 d4a3ed9310e5 1bb2e6237e03 12 6
272 aee31534993a d4a3ed9310e5 12 4
271 aee31534993a d4a3ed9310e5 12 4
273
272
274 Total: 32 18 (77.8% bigger)
273 Total: 32 18 (77.8% bigger)
275 y:
274 y:
276 Node Delta Base Delta Length Blob Size
275 Node Delta Base Delta Length Blob Size
277 577959738234 000000000000 70 8
276 577959738234 000000000000 70 8
278
277
279 Total: 70 8 (775.0% bigger)
278 Total: 70 8 (775.0% bigger)
280
279
281 $ hg cat -r ".^" x
280 $ hg cat -r ".^" x
282 x
281 x
283 x
282 x
284 x
283 x
285 x
284 x
286
285
287 Incremental repack
286 Incremental repack
288 $ rm -rf $CACHEDIR/master/packs/*
287 $ rm -rf $CACHEDIR/master/packs/*
289 $ cat >> .hg/hgrc <<EOF
288 $ cat >> .hg/hgrc <<EOF
290 > [remotefilelog]
289 > [remotefilelog]
291 > data.generations=60
290 > data.generations=60
292 > 150
291 > 150
293 > EOF
292 > EOF
294
293
295 Single pack - repack does nothing
294 Single pack - repack does nothing
296 $ hg prefetch -r 0
295 $ hg prefetch -r 0
297 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
296 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
298 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
297 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
299 [1]
298 [1]
300 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
299 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
301 [1]
300 [1]
302 $ hg repack --incremental
301 $ hg repack --incremental
303 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
302 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
304 -r--r--r-- 70 052643fdcdebbd42d7c180a651a30d46098e6fe1.datapack
303 -r--r--r-- 70 052643fdcdebbd42d7c180a651a30d46098e6fe1.datapack
305 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
304 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
306 -r--r--r-- 90 955a622173324b2d8b53e1147f209f1cf125302e.histpack
305 -r--r--r-- 90 955a622173324b2d8b53e1147f209f1cf125302e.histpack
307
306
308 3 gen1 packs, 1 gen0 pack - packs 3 gen1 into 1
307 3 gen1 packs, 1 gen0 pack - packs 3 gen1 into 1
309 $ hg prefetch -r 1
308 $ hg prefetch -r 1
310 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
309 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
311 $ hg prefetch -r 2
310 $ hg prefetch -r 2
312 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
311 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
313 $ hg prefetch -r 38
312 $ hg prefetch -r 38
314 abort: unknown revision '38'!
313 abort: unknown revision '38'!
315 [255]
314 [255]
316 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
315 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
317 -r--r--r-- 70 052643fdcdebbd42d7c180a651a30d46098e6fe1.datapack
316 -r--r--r-- 70 052643fdcdebbd42d7c180a651a30d46098e6fe1.datapack
318 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
317 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
319 -r--r--r-- 90 955a622173324b2d8b53e1147f209f1cf125302e.histpack
318 -r--r--r-- 90 955a622173324b2d8b53e1147f209f1cf125302e.histpack
320
319
321 For the data packs, setting the limit for the repackmaxpacksize to be 64 such
320 For the data packs, setting the limit for the repackmaxpacksize to be 64 such
322 that data pack with size 65 is more than the limit. This effectively ensures
321 that data pack with size 65 is more than the limit. This effectively ensures
323 that no generation has 3 packs and therefore, no packs are chosen for the
322 that no generation has 3 packs and therefore, no packs are chosen for the
324 incremental repacking. As for the history packs, setting repackmaxpacksize to be
323 incremental repacking. As for the history packs, setting repackmaxpacksize to be
325 0 which should always result in no repacking.
324 0 which should always result in no repacking.
326 $ hg repack --incremental --config remotefilelog.data.repackmaxpacksize=64 \
325 $ hg repack --incremental --config remotefilelog.data.repackmaxpacksize=64 \
327 > --config remotefilelog.history.repackmaxpacksize=0
326 > --config remotefilelog.history.repackmaxpacksize=0
328 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
327 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
329 -r--r--r-- 70 052643fdcdebbd42d7c180a651a30d46098e6fe1.datapack
328 -r--r--r-- 70 052643fdcdebbd42d7c180a651a30d46098e6fe1.datapack
330 -r--r--r-- 149 78840d69389c7404327f7477e3931c89945c37d1.datapack
329 -r--r--r-- 149 78840d69389c7404327f7477e3931c89945c37d1.datapack
331 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
330 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
332 -r--r--r-- 254 8abe7889aae389337d12ebe6085d4ee13854c7c9.histpack
331 -r--r--r-- 254 8abe7889aae389337d12ebe6085d4ee13854c7c9.histpack
333 -r--r--r-- 90 955a622173324b2d8b53e1147f209f1cf125302e.histpack
332 -r--r--r-- 90 955a622173324b2d8b53e1147f209f1cf125302e.histpack
334
333
335 Setting limit for the repackmaxpacksize to be the size of the biggest pack file
334 Setting limit for the repackmaxpacksize to be the size of the biggest pack file
336 which ensures that it is effectively ignored in the incremental repacking.
335 which ensures that it is effectively ignored in the incremental repacking.
337 $ hg repack --incremental --config remotefilelog.data.repackmaxpacksize=65 \
336 $ hg repack --incremental --config remotefilelog.data.repackmaxpacksize=65 \
338 > --config remotefilelog.history.repackmaxpacksize=336
337 > --config remotefilelog.history.repackmaxpacksize=336
339 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
338 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
340 -r--r--r-- 70 052643fdcdebbd42d7c180a651a30d46098e6fe1.datapack
339 -r--r--r-- 70 052643fdcdebbd42d7c180a651a30d46098e6fe1.datapack
341 -r--r--r-- 149 78840d69389c7404327f7477e3931c89945c37d1.datapack
340 -r--r--r-- 149 78840d69389c7404327f7477e3931c89945c37d1.datapack
342 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
341 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
343 -r--r--r-- 254 8abe7889aae389337d12ebe6085d4ee13854c7c9.histpack
342 -r--r--r-- 254 8abe7889aae389337d12ebe6085d4ee13854c7c9.histpack
344 -r--r--r-- 90 955a622173324b2d8b53e1147f209f1cf125302e.histpack
343 -r--r--r-- 90 955a622173324b2d8b53e1147f209f1cf125302e.histpack
345
344
346 1 gen3 pack, 1 gen0 pack - does nothing
345 1 gen3 pack, 1 gen0 pack - does nothing
347 $ hg repack --incremental
346 $ hg repack --incremental
348 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
347 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
349 -r--r--r-- 70 052643fdcdebbd42d7c180a651a30d46098e6fe1.datapack
348 -r--r--r-- 70 052643fdcdebbd42d7c180a651a30d46098e6fe1.datapack
350 -r--r--r-- 149 78840d69389c7404327f7477e3931c89945c37d1.datapack
349 -r--r--r-- 149 78840d69389c7404327f7477e3931c89945c37d1.datapack
351 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
350 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
352 -r--r--r-- 254 8abe7889aae389337d12ebe6085d4ee13854c7c9.histpack
351 -r--r--r-- 254 8abe7889aae389337d12ebe6085d4ee13854c7c9.histpack
353 -r--r--r-- 90 955a622173324b2d8b53e1147f209f1cf125302e.histpack
352 -r--r--r-- 90 955a622173324b2d8b53e1147f209f1cf125302e.histpack
354
353
355 Pull should run background repack
354 Pull should run background repack
356 $ cat >> .hg/hgrc <<EOF
355 $ cat >> .hg/hgrc <<EOF
357 > [remotefilelog]
356 > [remotefilelog]
358 > backgroundrepack=True
357 > backgroundrepack=True
359 > EOF
358 > EOF
360 $ clearcache
359 $ clearcache
361 $ hg prefetch -r 0
360 $ hg prefetch -r 0
362 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
361 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
363 $ hg prefetch -r 1
362 $ hg prefetch -r 1
364 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
363 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
365 $ hg prefetch -r 2
364 $ hg prefetch -r 2
366 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
365 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
367 $ hg prefetch -r 3
366 $ hg prefetch -r 3
368 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
367 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
369
368
370 $ hg pull
369 $ hg pull
371 pulling from ssh://user@dummy/master
370 pulling from ssh://user@dummy/master
372 searching for changes
371 searching for changes
373 no changes found
372 no changes found
374 (running background incremental repack)
373 (running background incremental repack)
375 $ sleep 0.5
376 $ hg debugwaitonrepack >/dev/null 2>&1
374 $ hg debugwaitonrepack >/dev/null 2>&1
377 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
375 $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
378 -r--r--r-- 303 156a6c1c83aeb69422d7936e0a46ba9bc06a71c0.datapack
376 -r--r--r-- 303 156a6c1c83aeb69422d7936e0a46ba9bc06a71c0.datapack
379 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
377 $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
380 -r--r--r-- 336 604552d403a1381749faf656feca0ca265a6d52c.histpack
378 -r--r--r-- 336 604552d403a1381749faf656feca0ca265a6d52c.histpack
381
379
382 Test environment variable resolution
380 Test environment variable resolution
383 $ CACHEPATH=$TESTTMP/envcache hg prefetch --config 'remotefilelog.cachepath=$CACHEPATH'
381 $ CACHEPATH=$TESTTMP/envcache hg prefetch --config 'remotefilelog.cachepath=$CACHEPATH'
384 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
382 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
385 $ find $TESTTMP/envcache | sort
383 $ find $TESTTMP/envcache | sort
386 $TESTTMP/envcache
384 $TESTTMP/envcache
387 $TESTTMP/envcache/master
385 $TESTTMP/envcache/master
388 $TESTTMP/envcache/master/95
386 $TESTTMP/envcache/master/95
389 $TESTTMP/envcache/master/95/cb0bfd2977c761298d9624e4b4d4c72a39974a
387 $TESTTMP/envcache/master/95/cb0bfd2977c761298d9624e4b4d4c72a39974a
390 $TESTTMP/envcache/master/95/cb0bfd2977c761298d9624e4b4d4c72a39974a/577959738234a1eb241ed3ed4b22a575833f56e0
388 $TESTTMP/envcache/master/95/cb0bfd2977c761298d9624e4b4d4c72a39974a/577959738234a1eb241ed3ed4b22a575833f56e0
391 $TESTTMP/envcache/repos
389 $TESTTMP/envcache/repos
392
390
393 Test local remotefilelog blob is correct when based on a pack
391 Test local remotefilelog blob is correct when based on a pack
394 $ hg prefetch -r .
392 $ hg prefetch -r .
395 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
393 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
396 $ echo >> y
394 $ echo >> y
397 $ hg commit -m y2
395 $ hg commit -m y2
398 $ hg debugremotefilelog .hg/store/data/95cb0bfd2977c761298d9624e4b4d4c72a39974a/b70860edba4f8242a1d52f2a94679dd23cb76808
396 $ hg debugremotefilelog .hg/store/data/95cb0bfd2977c761298d9624e4b4d4c72a39974a/b70860edba4f8242a1d52f2a94679dd23cb76808
399 size: 9 bytes
397 size: 9 bytes
400 path: .hg/store/data/95cb0bfd2977c761298d9624e4b4d4c72a39974a/b70860edba4f8242a1d52f2a94679dd23cb76808
398 path: .hg/store/data/95cb0bfd2977c761298d9624e4b4d4c72a39974a/b70860edba4f8242a1d52f2a94679dd23cb76808
401 key: b70860edba4f
399 key: b70860edba4f
402
400
403 node => p1 p2 linknode copyfrom
401 node => p1 p2 linknode copyfrom
404 b70860edba4f => 577959738234 000000000000 08d3fbc98c48
402 b70860edba4f => 577959738234 000000000000 08d3fbc98c48
405 577959738234 => 1bb2e6237e03 000000000000 c7faf2fc439a x
403 577959738234 => 1bb2e6237e03 000000000000 c7faf2fc439a x
406 1bb2e6237e03 => d4a3ed9310e5 000000000000 0b03bbc9e1e7
404 1bb2e6237e03 => d4a3ed9310e5 000000000000 0b03bbc9e1e7
407 d4a3ed9310e5 => aee31534993a 000000000000 421535db10b6
405 d4a3ed9310e5 => aee31534993a 000000000000 421535db10b6
408 aee31534993a => 1406e7411862 000000000000 a89d614e2364
406 aee31534993a => 1406e7411862 000000000000 a89d614e2364
409 1406e7411862 => 000000000000 000000000000 b292c1e3311f
407 1406e7411862 => 000000000000 000000000000 b292c1e3311f
410
408
411 Test limiting the max delta chain length
409 Test limiting the max delta chain length
412 $ hg repack --config packs.maxchainlen=1
410 $ hg repack --config packs.maxchainlen=1
413 $ hg debugdatapack $TESTTMP/hgcache/master/packs/*.dataidx
411 $ hg debugdatapack $TESTTMP/hgcache/master/packs/*.dataidx
414 $TESTTMP/hgcache/master/packs/f258af4c033dd5cd32b4dbc42a1efcd8e4c7d909:
412 $TESTTMP/hgcache/master/packs/f258af4c033dd5cd32b4dbc42a1efcd8e4c7d909:
415 x:
413 x:
416 Node Delta Base Delta Length Blob Size
414 Node Delta Base Delta Length Blob Size
417 1bb2e6237e03 000000000000 8 8
415 1bb2e6237e03 000000000000 8 8
418 d4a3ed9310e5 1bb2e6237e03 12 6
416 d4a3ed9310e5 1bb2e6237e03 12 6
419 aee31534993a 000000000000 4 4
417 aee31534993a 000000000000 4 4
420 1406e7411862 aee31534993a 12 2
418 1406e7411862 aee31534993a 12 2
421
419
422 Total: 36 20 (80.0% bigger)
420 Total: 36 20 (80.0% bigger)
423 y:
421 y:
424 Node Delta Base Delta Length Blob Size
422 Node Delta Base Delta Length Blob Size
425 577959738234 000000000000 70 8
423 577959738234 000000000000 70 8
426
424
427 Total: 70 8 (775.0% bigger)
425 Total: 70 8 (775.0% bigger)
428
426
429 Test huge pack cleanup using different values of packs.maxpacksize:
427 Test huge pack cleanup using different values of packs.maxpacksize:
430 $ hg repack --incremental --debug
428 $ hg repack --incremental --debug
431 $ hg repack --incremental --debug --config packs.maxpacksize=512
429 $ hg repack --incremental --debug --config packs.maxpacksize=512
432 removing oversize packfile $TESTTMP/hgcache/master/packs/f258af4c033dd5cd32b4dbc42a1efcd8e4c7d909.datapack (425 bytes)
430 removing oversize packfile $TESTTMP/hgcache/master/packs/f258af4c033dd5cd32b4dbc42a1efcd8e4c7d909.datapack (425 bytes)
433 removing oversize packfile $TESTTMP/hgcache/master/packs/f258af4c033dd5cd32b4dbc42a1efcd8e4c7d909.dataidx (1.21 KB)
431 removing oversize packfile $TESTTMP/hgcache/master/packs/f258af4c033dd5cd32b4dbc42a1efcd8e4c7d909.dataidx (1.21 KB)
434
432
435 Do a repack where the new pack reuses a delta from the old pack
433 Do a repack where the new pack reuses a delta from the old pack
436 $ clearcache
434 $ clearcache
437 $ hg prefetch -r '2::3'
435 $ hg prefetch -r '2::3'
438 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over * (glob)
436 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over * (glob)
439 $ hg repack
437 $ hg repack
440 $ hg debugdatapack $CACHEDIR/master/packs/*.datapack
438 $ hg debugdatapack $CACHEDIR/master/packs/*.datapack
441 $TESTTMP/hgcache/master/packs/9ec6b30891bd851320acb7c66b69a2bdf41c8df3:
439 $TESTTMP/hgcache/master/packs/9ec6b30891bd851320acb7c66b69a2bdf41c8df3:
442 x:
440 x:
443 Node Delta Base Delta Length Blob Size
441 Node Delta Base Delta Length Blob Size
444 1bb2e6237e03 000000000000 8 8
442 1bb2e6237e03 000000000000 8 8
445 d4a3ed9310e5 1bb2e6237e03 12 6
443 d4a3ed9310e5 1bb2e6237e03 12 6
446
444
447 Total: 20 14 (42.9% bigger)
445 Total: 20 14 (42.9% bigger)
448 $ hg prefetch -r '0::1'
446 $ hg prefetch -r '0::1'
449 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over * (glob)
447 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over * (glob)
450 $ hg repack
448 $ hg repack
451 $ hg debugdatapack $CACHEDIR/master/packs/*.datapack
449 $ hg debugdatapack $CACHEDIR/master/packs/*.datapack
452 $TESTTMP/hgcache/master/packs/156a6c1c83aeb69422d7936e0a46ba9bc06a71c0:
450 $TESTTMP/hgcache/master/packs/156a6c1c83aeb69422d7936e0a46ba9bc06a71c0:
453 x:
451 x:
454 Node Delta Base Delta Length Blob Size
452 Node Delta Base Delta Length Blob Size
455 1bb2e6237e03 000000000000 8 8
453 1bb2e6237e03 000000000000 8 8
456 d4a3ed9310e5 1bb2e6237e03 12 6
454 d4a3ed9310e5 1bb2e6237e03 12 6
457 aee31534993a d4a3ed9310e5 12 4
455 aee31534993a d4a3ed9310e5 12 4
458 1406e7411862 aee31534993a 12 2
456 1406e7411862 aee31534993a 12 2
459
457
460 Total: 44 20 (120.0% bigger)
458 Total: 44 20 (120.0% bigger)
General Comments 0
You need to be logged in to leave comments. Login now