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