| 1 |
|
| 2 |
initial setup |
| 3 |
|
| 4 |
$ hg init server |
| 5 |
$ cat >> server/.hg/hgrc << EOF |
| 6 |
> [extensions] |
| 7 |
> clonebundles = |
| 8 |
> |
| 9 |
> [clone-bundles] |
| 10 |
> auto-generate.on-change = yes |
| 11 |
> upload-command = sh -c 'cp "\$HGCB_BUNDLE_PATH" $TESTTMP_FORWARD_SLASH/final-upload/' |
| 12 |
> delete-command = sh -c 'rm -f $TESTTMP_FORWARD_SLASH/final-upload/\$HGCB_BASENAME' |
| 13 |
> url-template = file://$TESTTMP/final-upload/{basename} |
| 14 |
> |
| 15 |
> [devel] |
| 16 |
> debug.clonebundles=yes |
| 17 |
> EOF |
| 18 |
|
| 19 |
$ mkdir final-upload |
| 20 |
$ hg clone server client |
| 21 |
updating to branch default |
| 22 |
0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 23 |
$ cd client |
| 24 |
|
| 25 |
Test bundles are not generated if formats are not given |
| 26 |
======================================================= |
| 27 |
|
| 28 |
$ touch noformats |
| 29 |
$ hg -q commit -A -m 'add noformats' |
| 30 |
$ hg push |
| 31 |
pushing to $TESTTMP/server |
| 32 |
searching for changes |
| 33 |
clone-bundle auto-generate enabled, but no formats specified: disabling generation |
| 34 |
adding changesets |
| 35 |
adding manifests |
| 36 |
adding file changes |
| 37 |
added 1 changesets with 1 changes to 1 files |
| 38 |
$ test -f ../server/.hg/clonebundles.manifest |
| 39 |
[1] |
| 40 |
$ hg debugstrip -r tip |
| 41 |
0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
| 42 |
saved backup bundle to $TESTTMP/client/.hg/strip-backup/4823cdad4f38-4b2c3b65-backup.hg |
| 43 |
$ hg --cwd ../server debugstrip -r tip |
| 44 |
saved backup bundle to $TESTTMP/server/.hg/strip-backup/4823cdad4f38-4b2c3b65-backup.hg |
| 45 |
clone-bundle auto-generate enabled, but no formats specified: disabling generation |
| 46 |
clone-bundle auto-generate enabled, but no formats specified: disabling generation |
| 47 |
|
| 48 |
Test bundles are generated on push |
| 49 |
================================== |
| 50 |
|
| 51 |
$ cat >> ../server/.hg/hgrc << EOF |
| 52 |
> [clone-bundles] |
| 53 |
> auto-generate.formats = v2 |
| 54 |
> EOF |
| 55 |
$ touch foo |
| 56 |
$ hg -q commit -A -m 'add foo' |
| 57 |
$ touch bar |
| 58 |
$ hg -q commit -A -m 'add bar' |
| 59 |
|
| 60 |
Test that the HGCB_BUNDLE_BASENAME variable behaves as expected when unquoted. |
| 61 |
#if no-windows |
| 62 |
$ hg clone ../server '../embed-"-name/server' |
| 63 |
updating to branch default |
| 64 |
0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 65 |
$ cp ../server/.hg/hgrc '../embed-"-name/server/.hg/hgrc' |
| 66 |
|
| 67 |
$ mv ../final-upload/ ../final-upload.bak/ |
| 68 |
$ mkdir ../final-upload/ |
| 69 |
|
| 70 |
$ hg push --config paths.default='../embed-"-name/server' |
| 71 |
pushing to $TESTTMP/embed-"-name/server |
| 72 |
searching for changes |
| 73 |
adding changesets |
| 74 |
adding manifests |
| 75 |
adding file changes |
| 76 |
2 changesets found |
| 77 |
added 2 changesets with 2 changes to 2 files |
| 78 |
clone-bundles: starting bundle generation: bzip2-v2 |
| 79 |
|
| 80 |
Restore the original upload directory for windows test consistency |
| 81 |
$ rm -r ../final-upload/ |
| 82 |
$ mv ../final-upload.bak/ ../final-upload/ |
| 83 |
#endif |
| 84 |
|
| 85 |
$ hg push |
| 86 |
pushing to $TESTTMP/server |
| 87 |
searching for changes |
| 88 |
adding changesets |
| 89 |
adding manifests |
| 90 |
adding file changes |
| 91 |
2 changesets found |
| 92 |
added 2 changesets with 2 changes to 2 files |
| 93 |
clone-bundles: starting bundle generation: bzip2-v2 |
| 94 |
$ cat ../server/.hg/clonebundles.manifest |
| 95 |
file:/*/$TESTTMP/final-upload/full-bzip2-v2-2_revs-aaff8d2ffbbf_tip-*_txn.hg BUNDLESPEC=bzip2-v2 (glob) |
| 96 |
$ ls -1 ../final-upload |
| 97 |
full-bzip2-v2-2_revs-aaff8d2ffbbf_tip-*_txn.hg (glob) |
| 98 |
$ ls -1 ../server/.hg/tmp-bundles |
| 99 |
|
| 100 |
Newer bundles are generated with more pushes |
| 101 |
-------------------------------------------- |
| 102 |
|
| 103 |
$ touch baz |
| 104 |
$ hg -q commit -A -m 'add baz' |
| 105 |
$ touch buz |
| 106 |
$ hg -q commit -A -m 'add buz' |
| 107 |
$ hg push |
| 108 |
pushing to $TESTTMP/server |
| 109 |
searching for changes |
| 110 |
adding changesets |
| 111 |
adding manifests |
| 112 |
adding file changes |
| 113 |
4 changesets found |
| 114 |
added 2 changesets with 2 changes to 2 files |
| 115 |
clone-bundles: starting bundle generation: bzip2-v2 |
| 116 |
|
| 117 |
$ cat ../server/.hg/clonebundles.manifest |
| 118 |
file:/*/$TESTTMP/final-upload/full-bzip2-v2-4_revs-6427147b985a_tip-*_txn.hg BUNDLESPEC=bzip2-v2 (glob) |
| 119 |
$ ls -1 ../final-upload |
| 120 |
full-bzip2-v2-2_revs-aaff8d2ffbbf_tip-*_txn.hg (glob) |
| 121 |
full-bzip2-v2-4_revs-6427147b985a_tip-*_txn.hg (glob) |
| 122 |
$ ls -1 ../server/.hg/tmp-bundles |
| 123 |
|
| 124 |
Older bundles are cleaned up with more pushes |
| 125 |
--------------------------------------------- |
| 126 |
|
| 127 |
$ touch faz |
| 128 |
$ hg -q commit -A -m 'add faz' |
| 129 |
$ touch fuz |
| 130 |
$ hg -q commit -A -m 'add fuz' |
| 131 |
$ hg push |
| 132 |
pushing to $TESTTMP/server |
| 133 |
searching for changes |
| 134 |
adding changesets |
| 135 |
adding manifests |
| 136 |
adding file changes |
| 137 |
clone-bundles: deleting bundle full-bzip2-v2-2_revs-aaff8d2ffbbf_tip-*_txn.hg (glob) |
| 138 |
6 changesets found |
| 139 |
added 2 changesets with 2 changes to 2 files |
| 140 |
clone-bundles: starting bundle generation: bzip2-v2 |
| 141 |
|
| 142 |
$ cat ../server/.hg/clonebundles.manifest |
| 143 |
file:/*/$TESTTMP/final-upload/full-bzip2-v2-6_revs-b1010e95ea00_tip-*_txn.hg BUNDLESPEC=bzip2-v2 (glob) |
| 144 |
$ ls -1 ../final-upload |
| 145 |
full-bzip2-v2-4_revs-6427147b985a_tip-*_txn.hg (glob) |
| 146 |
full-bzip2-v2-6_revs-b1010e95ea00_tip-*_txn.hg (glob) |
| 147 |
$ ls -1 ../server/.hg/tmp-bundles |
| 148 |
|
| 149 |
Test conditions to get them generated |
| 150 |
===================================== |
| 151 |
|
| 152 |
Check ratio |
| 153 |
|
| 154 |
$ cat >> ../server/.hg/hgrc << EOF |
| 155 |
> [clone-bundles] |
| 156 |
> trigger.below-bundled-ratio = 0.5 |
| 157 |
> EOF |
| 158 |
$ touch far |
| 159 |
$ hg -q commit -A -m 'add far' |
| 160 |
$ hg push |
| 161 |
pushing to $TESTTMP/server |
| 162 |
searching for changes |
| 163 |
adding changesets |
| 164 |
adding manifests |
| 165 |
adding file changes |
| 166 |
added 1 changesets with 1 changes to 1 files |
| 167 |
$ cat ../server/.hg/clonebundles.manifest |
| 168 |
file:/*/$TESTTMP/final-upload/full-bzip2-v2-6_revs-b1010e95ea00_tip-*_txn.hg BUNDLESPEC=bzip2-v2 (glob) |
| 169 |
$ ls -1 ../final-upload |
| 170 |
full-bzip2-v2-4_revs-6427147b985a_tip-*_txn.hg (glob) |
| 171 |
full-bzip2-v2-6_revs-b1010e95ea00_tip-*_txn.hg (glob) |
| 172 |
$ ls -1 ../server/.hg/tmp-bundles |
| 173 |
|
| 174 |
Check absolute number of revisions |
| 175 |
|
| 176 |
$ cat >> ../server/.hg/hgrc << EOF |
| 177 |
> [clone-bundles] |
| 178 |
> trigger.revs = 2 |
| 179 |
> EOF |
| 180 |
$ touch bur |
| 181 |
$ hg -q commit -A -m 'add bur' |
| 182 |
$ hg push |
| 183 |
pushing to $TESTTMP/server |
| 184 |
searching for changes |
| 185 |
adding changesets |
| 186 |
adding manifests |
| 187 |
adding file changes |
| 188 |
clone-bundles: deleting bundle full-bzip2-v2-4_revs-6427147b985a_tip-*_txn.hg (glob) |
| 189 |
8 changesets found |
| 190 |
added 1 changesets with 1 changes to 1 files |
| 191 |
clone-bundles: starting bundle generation: bzip2-v2 |
| 192 |
$ cat ../server/.hg/clonebundles.manifest |
| 193 |
file:/*/$TESTTMP/final-upload/full-bzip2-v2-8_revs-8353e8af1306_tip-*_txn.hg BUNDLESPEC=bzip2-v2 (glob) |
| 194 |
$ ls -1 ../final-upload |
| 195 |
full-bzip2-v2-6_revs-b1010e95ea00_tip-*_txn.hg (glob) |
| 196 |
full-bzip2-v2-8_revs-8353e8af1306_tip-*_txn.hg (glob) |
| 197 |
$ ls -1 ../server/.hg/tmp-bundles |
| 198 |
|
| 199 |
(that one would not generate new bundles) |
| 200 |
|
| 201 |
$ touch tur |
| 202 |
$ hg -q commit -A -m 'add tur' |
| 203 |
$ hg push |
| 204 |
pushing to $TESTTMP/server |
| 205 |
searching for changes |
| 206 |
adding changesets |
| 207 |
adding manifests |
| 208 |
adding file changes |
| 209 |
added 1 changesets with 1 changes to 1 files |
| 210 |
$ cat ../server/.hg/clonebundles.manifest |
| 211 |
file:/*/$TESTTMP/final-upload/full-bzip2-v2-8_revs-8353e8af1306_tip-*_txn.hg BUNDLESPEC=bzip2-v2 (glob) |
| 212 |
$ ls -1 ../final-upload |
| 213 |
full-bzip2-v2-6_revs-b1010e95ea00_tip-*_txn.hg (glob) |
| 214 |
full-bzip2-v2-8_revs-8353e8af1306_tip-*_txn.hg (glob) |
| 215 |
$ ls -1 ../server/.hg/tmp-bundles |
| 216 |
|
| 217 |
Test generation through the dedicated command |
| 218 |
============================================= |
| 219 |
|
| 220 |
$ cat >> ../server/.hg/hgrc << EOF |
| 221 |
> [clone-bundles] |
| 222 |
> auto-generate.on-change = no |
| 223 |
> EOF |
| 224 |
|
| 225 |
Check the command can generate content when needed |
| 226 |
-------------------------------------------------- |
| 227 |
|
| 228 |
Do a push that makes the condition fulfilled, |
| 229 |
Yet it should not automatically generate a bundle with |
| 230 |
"auto-generate.on-change" not set. |
| 231 |
|
| 232 |
$ touch quoi |
| 233 |
$ hg -q commit -A -m 'add quoi' |
| 234 |
|
| 235 |
$ pre_push_manifest=`cat ../server/.hg/clonebundles.manifest|f --sha256 | sed 's/.*=//' | cat` |
| 236 |
$ pre_push_upload=`ls -1 ../final-upload|f --sha256 | sed 's/.*=//' | cat` |
| 237 |
$ ls -1 ../server/.hg/tmp-bundles |
| 238 |
|
| 239 |
$ hg push |
| 240 |
pushing to $TESTTMP/server |
| 241 |
searching for changes |
| 242 |
adding changesets |
| 243 |
adding manifests |
| 244 |
adding file changes |
| 245 |
added 1 changesets with 1 changes to 1 files |
| 246 |
|
| 247 |
$ post_push_manifest=`cat ../server/.hg/clonebundles.manifest|f --sha256 | sed 's/.*=//' | cat` |
| 248 |
$ post_push_upload=`ls -1 ../final-upload|f --sha256 | sed 's/.*=//' | cat` |
| 249 |
$ ls -1 ../server/.hg/tmp-bundles |
| 250 |
$ test "$pre_push_manifest" = "$post_push_manifest" |
| 251 |
$ test "$pre_push_upload" = "$post_push_upload" |
| 252 |
|
| 253 |
Running the command should detect the stale bundles, and do the full automatic |
| 254 |
generation logic. |
| 255 |
|
| 256 |
$ hg -R ../server/ admin::clone-bundles-refresh |
| 257 |
clone-bundles: deleting bundle full-bzip2-v2-6_revs-b1010e95ea00_tip-*_txn.hg (glob) |
| 258 |
clone-bundles: starting bundle generation: bzip2-v2 |
| 259 |
10 changesets found |
| 260 |
$ cat ../server/.hg/clonebundles.manifest |
| 261 |
file:/*/$TESTTMP/final-upload/full-bzip2-v2-10_revs-3b6f57f17d70_tip-*_acbr.hg BUNDLESPEC=bzip2-v2 (glob) |
| 262 |
$ ls -1 ../final-upload |
| 263 |
full-bzip2-v2-10_revs-3b6f57f17d70_tip-*_acbr.hg (glob) |
| 264 |
full-bzip2-v2-8_revs-8353e8af1306_tip-*_txn.hg (glob) |
| 265 |
$ ls -1 ../server/.hg/tmp-bundles |
| 266 |
|
| 267 |
Check the command cleans up older bundles when possible |
| 268 |
------------------------------------------------------- |
| 269 |
|
| 270 |
$ hg -R ../server/ admin::clone-bundles-refresh |
| 271 |
clone-bundles: deleting bundle full-bzip2-v2-8_revs-8353e8af1306_tip-*_txn.hg (glob) |
| 272 |
$ cat ../server/.hg/clonebundles.manifest |
| 273 |
file:/*/$TESTTMP/final-upload/full-bzip2-v2-10_revs-3b6f57f17d70_tip-*_acbr.hg BUNDLESPEC=bzip2-v2 (glob) |
| 274 |
$ ls -1 ../final-upload |
| 275 |
full-bzip2-v2-10_revs-3b6f57f17d70_tip-*_acbr.hg (glob) |
| 276 |
$ ls -1 ../server/.hg/tmp-bundles |
| 277 |
|
| 278 |
Nothing is generated when the bundles are sufficiently up to date |
| 279 |
----------------------------------------------------------------- |
| 280 |
|
| 281 |
$ touch feur |
| 282 |
$ hg -q commit -A -m 'add feur' |
| 283 |
|
| 284 |
$ pre_push_manifest=`cat ../server/.hg/clonebundles.manifest|f --sha256 | sed 's/.*=//' | cat` |
| 285 |
$ pre_push_upload=`ls -1 ../final-upload|f --sha256 | sed 's/.*=//' | cat` |
| 286 |
$ ls -1 ../server/.hg/tmp-bundles |
| 287 |
|
| 288 |
$ hg push |
| 289 |
pushing to $TESTTMP/server |
| 290 |
searching for changes |
| 291 |
adding changesets |
| 292 |
adding manifests |
| 293 |
adding file changes |
| 294 |
added 1 changesets with 1 changes to 1 files |
| 295 |
|
| 296 |
$ post_push_manifest=`cat ../server/.hg/clonebundles.manifest|f --sha256 | sed 's/.*=//' | cat` |
| 297 |
$ post_push_upload=`ls -1 ../final-upload|f --sha256 | sed 's/.*=//' | cat` |
| 298 |
$ ls -1 ../server/.hg/tmp-bundles |
| 299 |
$ test "$pre_push_manifest" = "$post_push_manifest" |
| 300 |
$ test "$pre_push_upload" = "$post_push_upload" |
| 301 |
|
| 302 |
$ hg -R ../server/ admin::clone-bundles-refresh |
| 303 |
|
| 304 |
$ post_refresh_manifest=`cat ../server/.hg/clonebundles.manifest|f --sha256 | sed 's/.*=//' | cat` |
| 305 |
$ post_refresh_upload=`ls -1 ../final-upload|f --sha256 | sed 's/.*=//' | cat` |
| 306 |
$ ls -1 ../server/.hg/tmp-bundles |
| 307 |
$ test "$pre_push_manifest" = "$post_refresh_manifest" |
| 308 |
$ test "$pre_push_upload" = "$post_refresh_upload" |
| 309 |
|
| 310 |
Test modification of configuration |
| 311 |
================================== |
| 312 |
|
| 313 |
Testing that later runs adapt to configuration changes even if the repository is |
| 314 |
unchanged. |
| 315 |
|
| 316 |
adding more formats |
| 317 |
------------------- |
| 318 |
|
| 319 |
bundle for added formats should be generated |
| 320 |
|
| 321 |
change configuration |
| 322 |
|
| 323 |
$ cat >> ../server/.hg/hgrc << EOF |
| 324 |
> [clone-bundles] |
| 325 |
> auto-generate.formats = v1, v2 |
| 326 |
> EOF |
| 327 |
|
| 328 |
refresh the bundles |
| 329 |
|
| 330 |
$ hg -R ../server/ admin::clone-bundles-refresh |
| 331 |
clone-bundles: starting bundle generation: bzip2-v1 |
| 332 |
11 changesets found |
| 333 |
|
| 334 |
the bundle for the "new" format should have been added |
| 335 |
|
| 336 |
$ cat ../server/.hg/clonebundles.manifest |
| 337 |
file:/*/$TESTTMP/final-upload/full-bzip2-v1-11_revs-4226b1cd5fda_tip-*_acbr.hg BUNDLESPEC=bzip2-v1 (glob) |
| 338 |
file:/*/$TESTTMP/final-upload/full-bzip2-v2-10_revs-3b6f57f17d70_tip-*_acbr.hg BUNDLESPEC=bzip2-v2 (glob) |
| 339 |
$ ls -1 ../final-upload |
| 340 |
full-bzip2-v1-11_revs-4226b1cd5fda_tip-*_acbr.hg (glob) |
| 341 |
full-bzip2-v2-10_revs-3b6f57f17d70_tip-*_acbr.hg (glob) |
| 342 |
$ ls -1 ../server/.hg/tmp-bundles |
| 343 |
|
| 344 |
Changing the ratio |
| 345 |
------------------ |
| 346 |
|
| 347 |
Changing the ratio to something that would have triggered a bundle during the last push. |
| 348 |
|
| 349 |
$ cat >> ../server/.hg/hgrc << EOF |
| 350 |
> [clone-bundles] |
| 351 |
> trigger.below-bundled-ratio = 0.95 |
| 352 |
> EOF |
| 353 |
|
| 354 |
refresh the bundles |
| 355 |
|
| 356 |
$ hg -R ../server/ admin::clone-bundles-refresh |
| 357 |
clone-bundles: starting bundle generation: bzip2-v2 |
| 358 |
11 changesets found |
| 359 |
|
| 360 |
|
| 361 |
the "outdated' bundle should be refreshed |
| 362 |
|
| 363 |
$ cat ../server/.hg/clonebundles.manifest |
| 364 |
file:/*/$TESTTMP/final-upload/full-bzip2-v1-11_revs-4226b1cd5fda_tip-*_acbr.hg BUNDLESPEC=bzip2-v1 (glob) |
| 365 |
file:/*/$TESTTMP/final-upload/full-bzip2-v2-11_revs-4226b1cd5fda_tip-*_acbr.hg BUNDLESPEC=bzip2-v2 (glob) |
| 366 |
$ ls -1 ../final-upload |
| 367 |
full-bzip2-v1-11_revs-4226b1cd5fda_tip-*_acbr.hg (glob) |
| 368 |
full-bzip2-v2-10_revs-3b6f57f17d70_tip-*_acbr.hg (glob) |
| 369 |
full-bzip2-v2-11_revs-4226b1cd5fda_tip-*_acbr.hg (glob) |
| 370 |
$ ls -1 ../server/.hg/tmp-bundles |
| 371 |
|
| 372 |
Test more command options |
| 373 |
========================= |
| 374 |
|
| 375 |
bundle clearing |
| 376 |
--------------- |
| 377 |
|
| 378 |
$ hg -R ../server/ admin::clone-bundles-clear |
| 379 |
clone-bundles: deleting bundle full-bzip2-v1-11_revs-4226b1cd5fda_tip-*_acbr.hg (glob) |
| 380 |
clone-bundles: deleting bundle full-bzip2-v2-10_revs-3b6f57f17d70_tip-*_acbr.hg (glob) |
| 381 |
clone-bundles: deleting bundle full-bzip2-v2-11_revs-4226b1cd5fda_tip-*_acbr.hg (glob) |
| 382 |
|
| 383 |
Nothing should remain |
| 384 |
|
| 385 |
$ cat ../server/.hg/clonebundles.manifest |
| 386 |
$ ls -1 ../final-upload |
| 387 |
$ ls -1 ../server/.hg/tmp-bundles |
| 388 |
|
| 389 |
background generation |
| 390 |
--------------------- |
| 391 |
|
| 392 |
generate bundle using background subprocess |
| 393 |
(since we are in devel mode, the command will still wait for the background |
| 394 |
process to end) |
| 395 |
|
| 396 |
$ hg -R ../server/ admin::clone-bundles-refresh --background |
| 397 |
11 changesets found |
| 398 |
11 changesets found |
| 399 |
clone-bundles: starting bundle generation: bzip2-v1 |
| 400 |
clone-bundles: starting bundle generation: bzip2-v2 |
| 401 |
|
| 402 |
bundles should have been generated |
| 403 |
|
| 404 |
$ cat ../server/.hg/clonebundles.manifest |
| 405 |
file:/*/$TESTTMP/final-upload/full-bzip2-v1-11_revs-4226b1cd5fda_tip-*_acbr.hg BUNDLESPEC=bzip2-v1 (glob) |
| 406 |
file:/*/$TESTTMP/final-upload/full-bzip2-v2-11_revs-4226b1cd5fda_tip-*_acbr.hg BUNDLESPEC=bzip2-v2 (glob) |
| 407 |
$ ls -1 ../final-upload |
| 408 |
full-bzip2-v1-11_revs-4226b1cd5fda_tip-*_acbr.hg (glob) |
| 409 |
full-bzip2-v2-11_revs-4226b1cd5fda_tip-*_acbr.hg (glob) |
| 410 |
$ ls -1 ../server/.hg/tmp-bundles |
| 411 |
|
| 412 |
background generation without debug |
| 413 |
----------------------------------- |
| 414 |
|
| 415 |
The debug option make the command wait for background process and change the |
| 416 |
way stdin is accessible to the script. So we also test this variant. |
| 417 |
|
| 418 |
Gather the name of the expected bundle |
| 419 |
|
| 420 |
$ v1_file=$TESTTMP/final-upload/full-bzip2-v1-11_revs-4226b1cd5fda_tip-background_testing.hg |
| 421 |
$ v2_file=$TESTTMP/final-upload/full-bzip2-v2-11_revs-4226b1cd5fda_tip-background_testing.hg |
| 422 |
|
| 423 |
cleanup things |
| 424 |
|
| 425 |
|
| 426 |
$ hg -R ../server/ admin::clone-bundles-clear |
| 427 |
clone-bundles: deleting bundle full-bzip2-v1-11_revs-4226b1cd5fda_tip-*_acbr.hg (glob) |
| 428 |
clone-bundles: deleting bundle full-bzip2-v2-11_revs-4226b1cd5fda_tip-*_acbr.hg (glob) |
| 429 |
(also delete the manifest to be sure) |
| 430 |
$ rm ../server/.hg/clonebundles.manifest |
| 431 |
|
| 432 |
Nothing should remain |
| 433 |
|
| 434 |
$ cat ../server/.hg/clonebundles.auto-gen |
| 435 |
$ ls -1 ../final-upload |
| 436 |
$ ls -1 ../server/.hg/tmp-bundles |
| 437 |
|
| 438 |
Start a process in the background without the debug option |
| 439 |
|
| 440 |
$ hg -R ../server/ admin::clone-bundles-refresh --background \ |
| 441 |
> --config devel.debug.clonebundles=no \ |
| 442 |
> --config devel.clonebundles.override-operation-id=background_testing |
| 443 |
|
| 444 |
$ $RUNTESTDIR/testlib/wait-on-file 30 $v1_file |
| 445 |
$ $RUNTESTDIR/testlib/wait-on-file 30 $v2_file |
| 446 |
|
| 447 |
all file created, but some cleanup might still be in progress, we wait 30 second for them |
| 448 |
|
| 449 |
# note: we should adjust that timing according to the test timeout, but that is more a |
| 450 |
# change for the default branch than the stable branch |
| 451 |
|
| 452 |
$ for x in `$RUNTESTDIR/seq.py 30`; do |
| 453 |
> if grep --invert-match DONE ../server/.hg/clonebundles.auto-gen > /dev/null; then |
| 454 |
> # some task still running |
| 455 |
> sleep 1 |
| 456 |
> continue |
| 457 |
> fi |
| 458 |
> # all task are done running |
| 459 |
> break |
| 460 |
> done |
| 461 |
|
| 462 |
We should have bundle now |
| 463 |
|
| 464 |
$ cat ../server/.hg/clonebundles.manifest |
| 465 |
file:/*/$TESTTMP/final-upload/full-bzip2-v1-11_revs-4226b1cd5fda_tip-background_testing.hg BUNDLESPEC=bzip2-v1 (glob) |
| 466 |
file:/*/$TESTTMP/final-upload/full-bzip2-v2-11_revs-4226b1cd5fda_tip-background_testing.hg BUNDLESPEC=bzip2-v2 (glob) |
| 467 |
$ ls -1 ../final-upload |
| 468 |
full-bzip2-v1-11_revs-4226b1cd5fda_tip-background_testing.hg |
| 469 |
full-bzip2-v2-11_revs-4226b1cd5fda_tip-background_testing.hg |
| 470 |
$ ls -1 ../server/.hg/tmp-bundles |
| 471 |
|
| 472 |
|
| 473 |
|
| 474 |
|
| 475 |
|
| 476 |
Test HTTP URL |
| 477 |
========================= |
| 478 |
|
| 479 |
$ hg -R ../server/ admin::clone-bundles-clear |
| 480 |
clone-bundles: deleting bundle full-bzip2-v1-11_revs-4226b1cd5fda_tip-*.hg (glob) |
| 481 |
clone-bundles: deleting bundle full-bzip2-v2-11_revs-4226b1cd5fda_tip-*.hg (glob) |
| 482 |
|
| 483 |
$ cat >> ../server/.hg/hgrc << EOF |
| 484 |
> [clone-bundles] |
| 485 |
> url-template = https://example.com/final-upload/{basename} |
| 486 |
> EOF |
| 487 |
$ hg -R ../server/ admin::clone-bundles-refresh |
| 488 |
clone-bundles: starting bundle generation: bzip2-v1 |
| 489 |
11 changesets found |
| 490 |
clone-bundles: starting bundle generation: bzip2-v2 |
| 491 |
11 changesets found |
| 492 |
|
| 493 |
|
| 494 |
bundles should have been generated with the SNIREQUIRED option |
| 495 |
|
| 496 |
$ cat ../server/.hg/clonebundles.manifest |
| 497 |
https://example.com/final-upload/full-bzip2-v1-11_revs-4226b1cd5fda_tip-*_acbr.hg BUNDLESPEC=bzip2-v1 REQUIRESNI=true (glob) |
| 498 |
https://example.com/final-upload/full-bzip2-v2-11_revs-4226b1cd5fda_tip-*_acbr.hg BUNDLESPEC=bzip2-v2 REQUIRESNI=true (glob) |
| 499 |
|
| 500 |
Test serving them through inline-clone bundle |
| 501 |
============================================= |
| 502 |
|
| 503 |
$ cat >> ../server/.hg/hgrc << EOF |
| 504 |
> [clone-bundles] |
| 505 |
> auto-generate.serve-inline=yes |
| 506 |
> EOF |
| 507 |
$ hg -R ../server/ admin::clone-bundles-clear |
| 508 |
clone-bundles: deleting bundle full-bzip2-v1-11_revs-4226b1cd5fda_tip-*_acbr.hg (glob) |
| 509 |
clone-bundles: deleting bundle full-bzip2-v2-11_revs-4226b1cd5fda_tip-*_acbr.hg (glob) |
| 510 |
|
| 511 |
initial generation |
| 512 |
------------------ |
| 513 |
|
| 514 |
|
| 515 |
$ hg -R ../server/ admin::clone-bundles-refresh |
| 516 |
clone-bundles: starting bundle generation: bzip2-v1 |
| 517 |
11 changesets found |
| 518 |
clone-bundles: starting bundle generation: bzip2-v2 |
| 519 |
11 changesets found |
| 520 |
$ cat ../server/.hg/clonebundles.manifest |
| 521 |
peer-bundle-cache://full-bzip2-v1-11_revs-4226b1cd5fda_tip-*_acbr.hg BUNDLESPEC=bzip2-v1 (glob) |
| 522 |
peer-bundle-cache://full-bzip2-v2-11_revs-4226b1cd5fda_tip-*_acbr.hg BUNDLESPEC=bzip2-v2 (glob) |
| 523 |
$ ls -1 ../server/.hg/bundle-cache |
| 524 |
full-bzip2-v1-11_revs-4226b1cd5fda_tip-*_acbr.hg (glob) |
| 525 |
full-bzip2-v2-11_revs-4226b1cd5fda_tip-*_acbr.hg (glob) |
| 526 |
$ ls -1 ../final-upload |
| 527 |
|
| 528 |
Regeneration eventually cleanup the old ones |
| 529 |
-------------------------------------------- |
| 530 |
|
| 531 |
create more content |
| 532 |
$ touch voit |
| 533 |
$ hg -q commit -A -m 'add voit' |
| 534 |
$ touch ar |
| 535 |
$ hg -q commit -A -m 'add ar' |
| 536 |
$ hg push |
| 537 |
pushing to $TESTTMP/server |
| 538 |
searching for changes |
| 539 |
adding changesets |
| 540 |
adding manifests |
| 541 |
adding file changes |
| 542 |
added 2 changesets with 2 changes to 2 files |
| 543 |
|
| 544 |
check first regeneration |
| 545 |
|
| 546 |
$ hg -R ../server/ admin::clone-bundles-refresh |
| 547 |
clone-bundles: starting bundle generation: bzip2-v1 |
| 548 |
13 changesets found |
| 549 |
clone-bundles: starting bundle generation: bzip2-v2 |
| 550 |
13 changesets found |
| 551 |
$ cat ../server/.hg/clonebundles.manifest |
| 552 |
peer-bundle-cache://full-bzip2-v1-13_revs-8a81f9be54ea_tip-*_acbr.hg BUNDLESPEC=bzip2-v1 (glob) |
| 553 |
peer-bundle-cache://full-bzip2-v2-13_revs-8a81f9be54ea_tip-*_acbr.hg BUNDLESPEC=bzip2-v2 (glob) |
| 554 |
$ ls -1 ../server/.hg/bundle-cache |
| 555 |
full-bzip2-v1-11_revs-4226b1cd5fda_tip-*_acbr.hg (glob) |
| 556 |
full-bzip2-v1-13_revs-8a81f9be54ea_tip-*_acbr.hg (glob) |
| 557 |
full-bzip2-v2-11_revs-4226b1cd5fda_tip-*_acbr.hg (glob) |
| 558 |
full-bzip2-v2-13_revs-8a81f9be54ea_tip-*_acbr.hg (glob) |
| 559 |
$ ls -1 ../final-upload |
| 560 |
|
| 561 |
check first regeneration (should cleanup the one before that last) |
| 562 |
|
| 563 |
$ touch "investi" |
| 564 |
$ hg -q commit -A -m 'add investi' |
| 565 |
$ touch "lesgisla" |
| 566 |
$ hg -q commit -A -m 'add lesgisla' |
| 567 |
$ hg push |
| 568 |
pushing to $TESTTMP/server |
| 569 |
searching for changes |
| 570 |
adding changesets |
| 571 |
adding manifests |
| 572 |
adding file changes |
| 573 |
added 2 changesets with 2 changes to 2 files |
| 574 |
|
| 575 |
$ hg -R ../server/ admin::clone-bundles-refresh |
| 576 |
clone-bundles: deleting inline bundle full-bzip2-v1-11_revs-4226b1cd5fda_tip-*_acbr.hg (glob) |
| 577 |
clone-bundles: deleting inline bundle full-bzip2-v2-11_revs-4226b1cd5fda_tip-*_acbr.hg (glob) |
| 578 |
clone-bundles: starting bundle generation: bzip2-v1 |
| 579 |
15 changesets found |
| 580 |
clone-bundles: starting bundle generation: bzip2-v2 |
| 581 |
15 changesets found |
| 582 |
$ cat ../server/.hg/clonebundles.manifest |
| 583 |
peer-bundle-cache://full-bzip2-v1-15_revs-17615b3984c2_tip-*_acbr.hg BUNDLESPEC=bzip2-v1 (glob) |
| 584 |
peer-bundle-cache://full-bzip2-v2-15_revs-17615b3984c2_tip-*_acbr.hg BUNDLESPEC=bzip2-v2 (glob) |
| 585 |
$ ls -1 ../server/.hg/bundle-cache |
| 586 |
full-bzip2-v1-13_revs-8a81f9be54ea_tip-*_acbr.hg (glob) |
| 587 |
full-bzip2-v1-15_revs-17615b3984c2_tip-*_acbr.hg (glob) |
| 588 |
full-bzip2-v2-13_revs-8a81f9be54ea_tip-*_acbr.hg (glob) |
| 589 |
full-bzip2-v2-15_revs-17615b3984c2_tip-*_acbr.hg (glob) |
| 590 |
$ ls -1 ../final-upload |
| 591 |
$ cd .. |
| 592 |
|
| 593 |
Check the url is correct |
| 594 |
------------------------ |
| 595 |
|
| 596 |
$ hg clone -U ssh://user@dummy/server ssh-inline-clone |
| 597 |
applying clone bundle from peer-bundle-cache://full-bzip2-v1-15_revs-17615b3984c2_tip-*_acbr.hg (glob) |
| 598 |
adding changesets |
| 599 |
adding manifests |
| 600 |
adding file changes |
| 601 |
added 15 changesets with 15 changes to 15 files |
| 602 |
finished applying clone bundle |
| 603 |
searching for changes |
| 604 |
no changes found |
| 605 |
15 local changesets published |
| 606 |
|
| 607 |
Test spec with boolean component (issue6960) |
| 608 |
============================================ |
| 609 |
|
| 610 |
$ cat >> ./server/.hg/hgrc << EOF |
| 611 |
> [clone-bundles] |
| 612 |
> auto-generate.formats = gzip-v2;obsolescence=yes,gzip-v3;obsolescence=no,gzip-v3;obsolescence=yes;obsolescence-mandatory=no |
| 613 |
> EOF |
| 614 |
|
| 615 |
$ rm ./server/.hg/clonebundles.manifest |
| 616 |
$ hg -R ./server/ admin::clone-bundles-refresh |
| 617 |
clone-bundles: deleting inline bundle full-bzip2-v1-13_revs-8a81f9be54ea_tip-*_acbr.hg (glob) |
| 618 |
clone-bundles: deleting inline bundle full-bzip2-v2-13_revs-8a81f9be54ea_tip-*_acbr.hg (glob) |
| 619 |
clone-bundles: starting bundle generation: gzip-v2;obsolescence=yes |
| 620 |
15 changesets found |
| 621 |
clone-bundles: starting bundle generation: gzip-v3;obsolescence=no |
| 622 |
15 changesets found |
| 623 |
clone-bundles: starting bundle generation: gzip-v3;obsolescence=yes;obsolescence-mandatory=no |
| 624 |
15 changesets found |
| 625 |
$ cat ./server/.hg/clonebundles.manifest |
| 626 |
peer-bundle-cache://full-bzip2-v1-15_revs-17615b3984c2_tip-*_acbr.hg BUNDLESPEC=bzip2-v1 (glob) |
| 627 |
peer-bundle-cache://full-bzip2-v2-15_revs-17615b3984c2_tip-*_acbr.hg BUNDLESPEC=bzip2-v2 (glob) |
| 628 |
peer-bundle-cache://full-gzip-v2;obsolescence=yes-15_revs-17615b3984c2_tip-*_acbr.hg BUNDLESPEC=gzip-v2;obsolescence=yes (glob) |
| 629 |
peer-bundle-cache://full-gzip-v3;obsolescence=no-15_revs-17615b3984c2_tip-*_acbr.hg BUNDLESPEC=gzip-v3;obsolescence=no (glob) |
| 630 |
peer-bundle-cache://full-gzip-v3;obsolescence=yes;obsolescence-mandatory=no-15_revs-17615b3984c2_tip-*_acbr.hg BUNDLESPEC=gzip-v3;obsolescence=yes;obsolescence-mandatory=no (glob) |
| 631 |
|
| 632 |
|
| 633 |
Check the manifest is correct |
| 634 |
----------------------------- |
| 635 |
|
| 636 |
$ hg clone -U ssh://user@dummy/server ssh-inline-more-param-clone |
| 637 |
applying clone bundle from peer-bundle-cache://full-bzip2-v1-15_revs-17615b3984c2_tip-*_acbr.hg (glob) |
| 638 |
adding changesets |
| 639 |
adding manifests |
| 640 |
adding file changes |
| 641 |
added 15 changesets with 15 changes to 15 files |
| 642 |
finished applying clone bundle |
| 643 |
searching for changes |
| 644 |
no changes found |
| 645 |
15 local changesets published |
| 646 |
|