##// END OF EJS Templates
upgrade: add '-' in optimization name...
Boris Feld -
r41120:5608b5a6 default
parent child Browse files
Show More
@@ -348,6 +348,19 b' def finddeficiencies(repo):'
348
348
349 return deficiencies
349 return deficiencies
350
350
351 # search without '-' to support older form on newer client.
352 #
353 # We don't enforce backward compatibility for debug command so this
354 # might eventually be dropped. However, having to use two different
355 # forms in script when comparing result is anoying enough to add
356 # backward compatibility for a while.
357 legacy_opts_map = {
358 'redeltaparent': 're-delta-parent',
359 'redeltamultibase': 're-delta-multibase',
360 'redeltaall': 're-delta-all',
361 'redeltafulladd': 're-delta-fulladd',
362 }
363
351 def findoptimizations(repo):
364 def findoptimizations(repo):
352 """Determine optimisation that could be used during upgrade"""
365 """Determine optimisation that could be used during upgrade"""
353 # These are unconditionally added. There is logic later that figures out
366 # These are unconditionally added. There is logic later that figures out
@@ -355,7 +368,7 b' def findoptimizations(repo):'
355 optimizations = []
368 optimizations = []
356
369
357 optimizations.append(improvement(
370 optimizations.append(improvement(
358 name='redeltaparent',
371 name='re-delta-parent',
359 type=optimisation,
372 type=optimisation,
360 description=_('deltas within internal storage will be recalculated to '
373 description=_('deltas within internal storage will be recalculated to '
361 'choose an optimal base revision where this was not '
374 'choose an optimal base revision where this was not '
@@ -368,7 +381,7 b' def findoptimizations(repo):'
368 'base revision if needed')))
381 'base revision if needed')))
369
382
370 optimizations.append(improvement(
383 optimizations.append(improvement(
371 name='redeltamultibase',
384 name='re-delta-multibase',
372 type=optimisation,
385 type=optimisation,
373 description=_('deltas within internal storage will be recalculated '
386 description=_('deltas within internal storage will be recalculated '
374 'against multiple base revision and the smallest '
387 'against multiple base revision and the smallest '
@@ -385,7 +398,7 b' def findoptimizations(repo):'
385 'significantly')))
398 'significantly')))
386
399
387 optimizations.append(improvement(
400 optimizations.append(improvement(
388 name='redeltaall',
401 name='re-delta-all',
389 type=optimisation,
402 type=optimisation,
390 description=_('deltas within internal storage will always be '
403 description=_('deltas within internal storage will always be '
391 'recalculated without reusing prior deltas; this will '
404 'recalculated without reusing prior deltas; this will '
@@ -396,12 +409,12 b' def findoptimizations(repo):'
396 'execution time')))
409 'execution time')))
397
410
398 optimizations.append(improvement(
411 optimizations.append(improvement(
399 name='redeltafulladd',
412 name='re-delta-fulladd',
400 type=optimisation,
413 type=optimisation,
401 description=_('every revision will be re-added as if it was new '
414 description=_('every revision will be re-added as if it was new '
402 'content. It will go through the full storage '
415 'content. It will go through the full storage '
403 'mechanism giving extensions a chance to process it '
416 'mechanism giving extensions a chance to process it '
404 '(eg. lfs). This is similar to "redeltaall" but even '
417 '(eg. lfs). This is similar to "re-delta-all" but even '
405 'slower since more logic is involved.'),
418 'slower since more logic is involved.'),
406 upgrademessage=_('each revision will be added as new content to the '
419 upgrademessage=_('each revision will be added as new content to the '
407 'internal storage; this will likely drastically slow '
420 'internal storage; this will likely drastically slow '
@@ -654,20 +667,20 b' def _upgraderepo(ui, srcrepo, dstrepo, r'
654 ui.write(_('(it is safe to interrupt this process any time before '
667 ui.write(_('(it is safe to interrupt this process any time before '
655 'data migration completes)\n'))
668 'data migration completes)\n'))
656
669
657 if 'redeltaall' in actions:
670 if 're-delta-all' in actions:
658 deltareuse = revlog.revlog.DELTAREUSENEVER
671 deltareuse = revlog.revlog.DELTAREUSENEVER
659 elif 'redeltaparent' in actions:
672 elif 're-delta-parent' in actions:
660 deltareuse = revlog.revlog.DELTAREUSESAMEREVS
673 deltareuse = revlog.revlog.DELTAREUSESAMEREVS
661 elif 'redeltamultibase' in actions:
674 elif 're-delta-multibase' in actions:
662 deltareuse = revlog.revlog.DELTAREUSESAMEREVS
675 deltareuse = revlog.revlog.DELTAREUSESAMEREVS
663 elif 'redeltafulladd' in actions:
676 elif 're-delta-fulladd' in actions:
664 deltareuse = revlog.revlog.DELTAREUSEFULLADD
677 deltareuse = revlog.revlog.DELTAREUSEFULLADD
665 else:
678 else:
666 deltareuse = revlog.revlog.DELTAREUSEALWAYS
679 deltareuse = revlog.revlog.DELTAREUSEALWAYS
667
680
668 with dstrepo.transaction('upgrade') as tr:
681 with dstrepo.transaction('upgrade') as tr:
669 _copyrevlogs(ui, srcrepo, dstrepo, tr, deltareuse,
682 _copyrevlogs(ui, srcrepo, dstrepo, tr, deltareuse,
670 'redeltamultibase' in actions)
683 're-delta-multibase' in actions)
671
684
672 # Now copy other files in the store directory.
685 # Now copy other files in the store directory.
673 # The sorted() makes execution deterministic.
686 # The sorted() makes execution deterministic.
@@ -731,7 +744,9 b' def _upgraderepo(ui, srcrepo, dstrepo, r'
731
744
732 def upgraderepo(ui, repo, run=False, optimize=None):
745 def upgraderepo(ui, repo, run=False, optimize=None):
733 """Upgrade a repository in place."""
746 """Upgrade a repository in place."""
734 optimize = set(optimize or [])
747 if optimize is None:
748 optimize = []
749 optimize = set(legacy_opts_map.get(o, o) for o in optimize)
735 repo = repo.unfiltered()
750 repo = repo.unfiltered()
736
751
737 # Ensure the repository can be upgraded.
752 # Ensure the repository can be upgraded.
@@ -131,17 +131,17 b' An upgrade of a repository created with '
131
131
132 additional optimizations are available by specifying "--optimize <name>":
132 additional optimizations are available by specifying "--optimize <name>":
133
133
134 redeltaparent
134 re-delta-parent
135 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
135 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
136
136
137 redeltamultibase
137 re-delta-multibase
138 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
138 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
139
139
140 redeltaall
140 re-delta-all
141 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
141 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
142
142
143 redeltafulladd
143 re-delta-fulladd
144 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "redeltaall" but even slower since more logic is involved.
144 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
145
145
146
146
147 --optimize can be used to add optimizations
147 --optimize can be used to add optimizations
@@ -153,20 +153,51 b' An upgrade of a repository created with '
153 requirements
153 requirements
154 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
154 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
155
155
156 redeltaparent
156 re-delta-parent
157 deltas within internal storage will choose a new base revision if needed
157 deltas within internal storage will choose a new base revision if needed
158
158
159 additional optimizations are available by specifying "--optimize <name>":
159 additional optimizations are available by specifying "--optimize <name>":
160
160
161 redeltamultibase
161 re-delta-multibase
162 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
162 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
163
163
164 redeltaall
164 re-delta-all
165 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
165 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
166
166
167 redeltafulladd
167 re-delta-fulladd
168 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "redeltaall" but even slower since more logic is involved.
168 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
169
170
171 modern form of the option
172
173 $ hg debugupgrade --optimize re-delta-parent
174 (no feature deficiencies found in existing repository)
175 performing an upgrade with "--run" will make the following changes:
176
177 requirements
178 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
179
180 re-delta-parent
181 deltas within internal storage will choose a new base revision if needed
169
182
183 additional optimizations are available by specifying "--optimize <name>":
184
185 re-delta-multibase
186 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
187
188 re-delta-all
189 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
190
191 re-delta-fulladd
192 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
193
194
195 unknown optimization:
196
197 $ hg debugupgrade --optimize foobar
198 abort: unknown optimization action requested: foobar
199 (run without arguments to see valid optimizations)
200 [255]
170
201
171 Various sub-optimal detections work
202 Various sub-optimal detections work
172
203
@@ -243,17 +274,17 b' Various sub-optimal detections work'
243
274
244 additional optimizations are available by specifying "--optimize <name>":
275 additional optimizations are available by specifying "--optimize <name>":
245
276
246 redeltaparent
277 re-delta-parent
247 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
278 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
248
279
249 redeltamultibase
280 re-delta-multibase
250 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
281 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
251
282
252 redeltaall
283 re-delta-all
253 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
284 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
254
285
255 redeltafulladd
286 re-delta-fulladd
256 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "redeltaall" but even slower since more logic is involved.
287 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
257
288
258
289
259 $ hg --config format.dotencode=false debugupgraderepo
290 $ hg --config format.dotencode=false debugupgraderepo
@@ -291,17 +322,17 b' Various sub-optimal detections work'
291
322
292 additional optimizations are available by specifying "--optimize <name>":
323 additional optimizations are available by specifying "--optimize <name>":
293
324
294 redeltaparent
325 re-delta-parent
295 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
326 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
296
327
297 redeltamultibase
328 re-delta-multibase
298 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
329 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
299
330
300 redeltaall
331 re-delta-all
301 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
332 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
302
333
303 redeltafulladd
334 re-delta-fulladd
304 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "redeltaall" but even slower since more logic is involved.
335 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
305
336
306
337
307 $ cd ..
338 $ cd ..
@@ -480,7 +511,7 b" store files with special filenames aren'"
480 requirements
511 requirements
481 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
512 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
482
513
483 redeltafulladd
514 re-delta-fulladd
484 each revision will be added as new content to the internal storage; this will likely drastically slow down execution time, but some extensions might need it
515 each revision will be added as new content to the internal storage; this will likely drastically slow down execution time, but some extensions might need it
485
516
486 beginning upgrade...
517 beginning upgrade...
@@ -692,7 +723,7 b' repository config is taken in account'
692 requirements
723 requirements
693 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
724 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
694
725
695 redeltaall
726 re-delta-all
696 deltas within internal storage will be fully recomputed; this will likely drastically slow down execution time
727 deltas within internal storage will be fully recomputed; this will likely drastically slow down execution time
697
728
698 beginning upgrade...
729 beginning upgrade...
General Comments 0
You need to be logged in to leave comments. Login now