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