##// END OF EJS Templates
clone-bundles: add a configuration to control auto-generation on changes...
marmoute -
r51303:65fb4ced default
parent child Browse files
Show More
@@ -223,16 +223,22 b' different variant will be defined by the'
223
223
224 See `hg help bundlespec` for details about available options.
224 See `hg help bundlespec` for details about available options.
225
225
226 Bundles are not generated on each push. By default new bundles are generated
226 By default, new bundles are generated when 5% of the repository contents or at
227 when 5% of the repository content or at least 1000 revisions are not contained
227 least 1000 revisions are not contained in the cached bundles. This option can
228 in the cached bundles. This option can be controled by the
228 be controlled by the `clone-bundles.trigger.below-bundled-ratio` option
229 `clone-bundles.trigger.below-bundled-ratio` option (default to 0.95) and the
229 (default 0.95) and the `clone-bundles.trigger.revs` option (default 1000)::
230 `clone-bundles.trigger.revs` options (default 1000)::
231
230
232 [clone-bundles]
231 [clone-bundles]
233 trigger.below-bundled-ratio=0.95
232 trigger.below-bundled-ratio=0.95
234 trigger.revs=1000
233 trigger.revs=1000
235
234
235 This logic can be automatically triggered on each repository changes if
236 `clone-bundles.auto-generate.on-change` is set to `yes`.
237
238 [clone-bundles]
239 auto-generate.on-change=yes
240 auto-generate.formats= zstd-v2, gzip-v2
241
236 Bundles Upload and Serving:
242 Bundles Upload and Serving:
237 ...........................
243 ...........................
238
244
@@ -320,6 +326,7 b' configitem = registrar.configitem(config'
320 cmdtable = {}
326 cmdtable = {}
321 command = registrar.command(cmdtable)
327 command = registrar.command(cmdtable)
322
328
329 configitem(b'clone-bundles', b'auto-generate.on-change', default=False)
323 configitem(b'clone-bundles', b'auto-generate.formats', default=list)
330 configitem(b'clone-bundles', b'auto-generate.formats', default=list)
324 configitem(b'clone-bundles', b'trigger.below-bundled-ratio', default=0.95)
331 configitem(b'clone-bundles', b'trigger.below-bundled-ratio', default=0.95)
325 configitem(b'clone-bundles', b'trigger.revs', default=1000)
332 configitem(b'clone-bundles', b'trigger.revs', default=1000)
@@ -897,10 +904,14 b' def reposetup(ui, repo):'
897 class autobundlesrepo(repo.__class__):
904 class autobundlesrepo(repo.__class__):
898 def transaction(self, *args, **kwargs):
905 def transaction(self, *args, **kwargs):
899 tr = super(autobundlesrepo, self).transaction(*args, **kwargs)
906 tr = super(autobundlesrepo, self).transaction(*args, **kwargs)
907 enabled = repo.ui.configbool(
908 b'clone-bundles',
909 b'auto-generate.on-change',
910 )
900 targets = repo.ui.configlist(
911 targets = repo.ui.configlist(
901 b'clone-bundles', b'auto-generate.formats'
912 b'clone-bundles', b'auto-generate.formats'
902 )
913 )
903 if targets:
914 if enabled and targets:
904 tr.addpostclose(CAT_POSTCLOSE, make_auto_bundler(self))
915 tr.addpostclose(CAT_POSTCLOSE, make_auto_bundler(self))
905 return tr
916 return tr
906
917
@@ -9,6 +9,7 b' initial setup'
9 > clonebundles =
9 > clonebundles =
10 >
10 >
11 > [clone-bundles]
11 > [clone-bundles]
12 > auto-generate.on-change = yes
12 > auto-generate.formats = v2
13 > auto-generate.formats = v2
13 > upload-command = cp "\$HGCB_BUNDLE_PATH" "$TESTTMP"/final-upload/
14 > upload-command = cp "\$HGCB_BUNDLE_PATH" "$TESTTMP"/final-upload/
14 > delete-command = rm -f "$TESTTMP/final-upload/\$HGCB_BASENAME"
15 > delete-command = rm -f "$TESTTMP/final-upload/\$HGCB_BASENAME"
General Comments 0
You need to be logged in to leave comments. Login now