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