Show More
@@ -541,96 +541,102 b' legacy_opts_map = {' | |||||
541 | b'redeltafulladd': b're-delta-fulladd', |
|
541 | b'redeltafulladd': b're-delta-fulladd', | |
542 | } |
|
542 | } | |
543 |
|
543 | |||
|
544 | ALL_OPTIMISATIONS = [] | |||
|
545 | ||||
|
546 | ||||
|
547 | def register_optimization(obj): | |||
|
548 | ALL_OPTIMISATIONS.append(obj) | |||
|
549 | return obj | |||
|
550 | ||||
|
551 | ||||
|
552 | register_optimization( | |||
|
553 | improvement( | |||
|
554 | name=b're-delta-parent', | |||
|
555 | type=OPTIMISATION, | |||
|
556 | description=_( | |||
|
557 | b'deltas within internal storage will be recalculated to ' | |||
|
558 | b'choose an optimal base revision where this was not ' | |||
|
559 | b'already done; the size of the repository may shrink and ' | |||
|
560 | b'various operations may become faster; the first time ' | |||
|
561 | b'this optimization is performed could slow down upgrade ' | |||
|
562 | b'execution considerably; subsequent invocations should ' | |||
|
563 | b'not run noticeably slower' | |||
|
564 | ), | |||
|
565 | upgrademessage=_( | |||
|
566 | b'deltas within internal storage will choose a new ' | |||
|
567 | b'base revision if needed' | |||
|
568 | ), | |||
|
569 | ) | |||
|
570 | ) | |||
|
571 | ||||
|
572 | register_optimization( | |||
|
573 | improvement( | |||
|
574 | name=b're-delta-multibase', | |||
|
575 | type=OPTIMISATION, | |||
|
576 | description=_( | |||
|
577 | b'deltas within internal storage will be recalculated ' | |||
|
578 | b'against multiple base revision and the smallest ' | |||
|
579 | b'difference will be used; the size of the repository may ' | |||
|
580 | b'shrink significantly when there are many merges; this ' | |||
|
581 | b'optimization will slow down execution in proportion to ' | |||
|
582 | b'the number of merges in the repository and the amount ' | |||
|
583 | b'of files in the repository; this slow down should not ' | |||
|
584 | b'be significant unless there are tens of thousands of ' | |||
|
585 | b'files and thousands of merges' | |||
|
586 | ), | |||
|
587 | upgrademessage=_( | |||
|
588 | b'deltas within internal storage will choose an ' | |||
|
589 | b'optimal delta by computing deltas against multiple ' | |||
|
590 | b'parents; may slow down execution time ' | |||
|
591 | b'significantly' | |||
|
592 | ), | |||
|
593 | ) | |||
|
594 | ) | |||
|
595 | ||||
|
596 | register_optimization( | |||
|
597 | improvement( | |||
|
598 | name=b're-delta-all', | |||
|
599 | type=OPTIMISATION, | |||
|
600 | description=_( | |||
|
601 | b'deltas within internal storage will always be ' | |||
|
602 | b'recalculated without reusing prior deltas; this will ' | |||
|
603 | b'likely make execution run several times slower; this ' | |||
|
604 | b'optimization is typically not needed' | |||
|
605 | ), | |||
|
606 | upgrademessage=_( | |||
|
607 | b'deltas within internal storage will be fully ' | |||
|
608 | b'recomputed; this will likely drastically slow down ' | |||
|
609 | b'execution time' | |||
|
610 | ), | |||
|
611 | ) | |||
|
612 | ) | |||
|
613 | ||||
|
614 | register_optimization( | |||
|
615 | improvement( | |||
|
616 | name=b're-delta-fulladd', | |||
|
617 | type=OPTIMISATION, | |||
|
618 | description=_( | |||
|
619 | b'every revision will be re-added as if it was new ' | |||
|
620 | b'content. It will go through the full storage ' | |||
|
621 | b'mechanism giving extensions a chance to process it ' | |||
|
622 | b'(eg. lfs). This is similar to "re-delta-all" but even ' | |||
|
623 | b'slower since more logic is involved.' | |||
|
624 | ), | |||
|
625 | upgrademessage=_( | |||
|
626 | b'each revision will be added as new content to the ' | |||
|
627 | b'internal storage; this will likely drastically slow ' | |||
|
628 | b'down execution time, but some extensions might need ' | |||
|
629 | b'it' | |||
|
630 | ), | |||
|
631 | ) | |||
|
632 | ) | |||
|
633 | ||||
544 |
|
634 | |||
545 | def findoptimizations(repo): |
|
635 | def findoptimizations(repo): | |
546 | """Determine optimisation that could be used during upgrade""" |
|
636 | """Determine optimisation that could be used during upgrade""" | |
547 | # These are unconditionally added. There is logic later that figures out |
|
637 | # These are unconditionally added. There is logic later that figures out | |
548 | # which ones to apply. |
|
638 | # which ones to apply. | |
549 | optimizations = [] |
|
639 | return list(ALL_OPTIMISATIONS) | |
550 |
|
||||
551 | optimizations.append( |
|
|||
552 | improvement( |
|
|||
553 | name=b're-delta-parent', |
|
|||
554 | type=OPTIMISATION, |
|
|||
555 | description=_( |
|
|||
556 | b'deltas within internal storage will be recalculated to ' |
|
|||
557 | b'choose an optimal base revision where this was not ' |
|
|||
558 | b'already done; the size of the repository may shrink and ' |
|
|||
559 | b'various operations may become faster; the first time ' |
|
|||
560 | b'this optimization is performed could slow down upgrade ' |
|
|||
561 | b'execution considerably; subsequent invocations should ' |
|
|||
562 | b'not run noticeably slower' |
|
|||
563 | ), |
|
|||
564 | upgrademessage=_( |
|
|||
565 | b'deltas within internal storage will choose a new ' |
|
|||
566 | b'base revision if needed' |
|
|||
567 | ), |
|
|||
568 | ) |
|
|||
569 | ) |
|
|||
570 |
|
||||
571 | optimizations.append( |
|
|||
572 | improvement( |
|
|||
573 | name=b're-delta-multibase', |
|
|||
574 | type=OPTIMISATION, |
|
|||
575 | description=_( |
|
|||
576 | b'deltas within internal storage will be recalculated ' |
|
|||
577 | b'against multiple base revision and the smallest ' |
|
|||
578 | b'difference will be used; the size of the repository may ' |
|
|||
579 | b'shrink significantly when there are many merges; this ' |
|
|||
580 | b'optimization will slow down execution in proportion to ' |
|
|||
581 | b'the number of merges in the repository and the amount ' |
|
|||
582 | b'of files in the repository; this slow down should not ' |
|
|||
583 | b'be significant unless there are tens of thousands of ' |
|
|||
584 | b'files and thousands of merges' |
|
|||
585 | ), |
|
|||
586 | upgrademessage=_( |
|
|||
587 | b'deltas within internal storage will choose an ' |
|
|||
588 | b'optimal delta by computing deltas against multiple ' |
|
|||
589 | b'parents; may slow down execution time ' |
|
|||
590 | b'significantly' |
|
|||
591 | ), |
|
|||
592 | ) |
|
|||
593 | ) |
|
|||
594 |
|
||||
595 | optimizations.append( |
|
|||
596 | improvement( |
|
|||
597 | name=b're-delta-all', |
|
|||
598 | type=OPTIMISATION, |
|
|||
599 | description=_( |
|
|||
600 | b'deltas within internal storage will always be ' |
|
|||
601 | b'recalculated without reusing prior deltas; this will ' |
|
|||
602 | b'likely make execution run several times slower; this ' |
|
|||
603 | b'optimization is typically not needed' |
|
|||
604 | ), |
|
|||
605 | upgrademessage=_( |
|
|||
606 | b'deltas within internal storage will be fully ' |
|
|||
607 | b'recomputed; this will likely drastically slow down ' |
|
|||
608 | b'execution time' |
|
|||
609 | ), |
|
|||
610 | ) |
|
|||
611 | ) |
|
|||
612 |
|
||||
613 | optimizations.append( |
|
|||
614 | improvement( |
|
|||
615 | name=b're-delta-fulladd', |
|
|||
616 | type=OPTIMISATION, |
|
|||
617 | description=_( |
|
|||
618 | b'every revision will be re-added as if it was new ' |
|
|||
619 | b'content. It will go through the full storage ' |
|
|||
620 | b'mechanism giving extensions a chance to process it ' |
|
|||
621 | b'(eg. lfs). This is similar to "re-delta-all" but even ' |
|
|||
622 | b'slower since more logic is involved.' |
|
|||
623 | ), |
|
|||
624 | upgrademessage=_( |
|
|||
625 | b'each revision will be added as new content to the ' |
|
|||
626 | b'internal storage; this will likely drastically slow ' |
|
|||
627 | b'down execution time, but some extensions might need ' |
|
|||
628 | b'it' |
|
|||
629 | ), |
|
|||
630 | ) |
|
|||
631 | ) |
|
|||
632 |
|
||||
633 | return optimizations |
|
|||
634 |
|
640 | |||
635 |
|
641 | |||
636 | def determineactions(repo, deficiencies, sourcereqs, destreqs): |
|
642 | def determineactions(repo, deficiencies, sourcereqs, destreqs): |
General Comments 0
You need to be logged in to leave comments.
Login now