Show More
@@ -840,7 +840,24 b' class _DeltaSearch(_BaseDeltaSearch):' | |||||
840 | assert self.revlog.delta_config.general_delta |
|
840 | assert self.revlog.delta_config.general_delta | |
841 | self._candidates_iterator = self._refined_groups() |
|
841 | self._candidates_iterator = self._refined_groups() | |
842 | self._last_good = None |
|
842 | self._last_good = None | |
843 | self._next_internal_group() |
|
843 | if ( | |
|
844 | self.cachedelta is not None | |||
|
845 | and self.cachedelta[2] > DELTA_BASE_REUSE_NO | |||
|
846 | and self._pre_filter_rev(self.cachedelta[0]) | |||
|
847 | ): | |||
|
848 | # First we try to reuse a the delta contained in the bundle. (or from | |||
|
849 | # the source revlog) | |||
|
850 | # | |||
|
851 | # This logic only applies to general delta repositories and can be | |||
|
852 | # disabled through configuration. Disabling reuse source delta is | |||
|
853 | # useful when we want to make sure we recomputed "optimal" deltas. | |||
|
854 | self.current_stage = _STAGE_CACHED | |||
|
855 | self._internal_group = (self.cachedelta[0],) | |||
|
856 | self._internal_idx = 0 | |||
|
857 | self.current_group = self._internal_group | |||
|
858 | self.tested.update(self.current_group) | |||
|
859 | else: | |||
|
860 | self._next_internal_group() | |||
844 |
|
861 | |||
845 | def _next_internal_group(self): |
|
862 | def _next_internal_group(self): | |
846 | # self._internal_group can be larger than self.current_group |
|
863 | # self._internal_group can be larger than self.current_group | |
@@ -868,6 +885,14 b' class _DeltaSearch(_BaseDeltaSearch):' | |||||
868 | old_good = self._last_good |
|
885 | old_good = self._last_good | |
869 | if good_delta is not None: |
|
886 | if good_delta is not None: | |
870 | self._last_good = good_delta.base |
|
887 | self._last_good = good_delta.base | |
|
888 | if self.current_stage == _STAGE_CACHED and good_delta is not None: | |||
|
889 | # the cache is good, let us use the cache as requested | |||
|
890 | self._candidates_iterator = None | |||
|
891 | self._internal_group = None | |||
|
892 | self._internal_idx = None | |||
|
893 | self.current_group = None | |||
|
894 | return | |||
|
895 | ||||
871 | if (self._internal_idx < len(self._internal_group)) and ( |
|
896 | if (self._internal_idx < len(self._internal_group)) and ( | |
872 | old_good != good_delta |
|
897 | old_good != good_delta | |
873 | ): |
|
898 | ): | |
@@ -1032,23 +1057,6 b' class _DeltaSearch(_BaseDeltaSearch):' | |||||
1032 |
|
1057 | |||
1033 | def _refined_groups(self): |
|
1058 | def _refined_groups(self): | |
1034 | good = None |
|
1059 | good = None | |
1035 | # First we try to reuse a the delta contained in the bundle. (or from |
|
|||
1036 | # the source revlog) |
|
|||
1037 | # |
|
|||
1038 | # This logic only applies to general delta repositories and can be |
|
|||
1039 | # disabled through configuration. Disabling reuse source delta is |
|
|||
1040 | # useful when we want to make sure we recomputed "optimal" deltas. |
|
|||
1041 | if ( |
|
|||
1042 | self.cachedelta is not None |
|
|||
1043 | and self.cachedelta[2] > DELTA_BASE_REUSE_NO |
|
|||
1044 | ): |
|
|||
1045 | # Assume what we received from the server is a good choice |
|
|||
1046 | # build delta will reuse the cache |
|
|||
1047 | self.current_stage = _STAGE_CACHED |
|
|||
1048 | good = yield (self.cachedelta[0],) |
|
|||
1049 | if good is not None: |
|
|||
1050 | yield None |
|
|||
1051 | return |
|
|||
1052 | groups = self._raw_groups() |
|
1060 | groups = self._raw_groups() | |
1053 | for candidates in groups: |
|
1061 | for candidates in groups: | |
1054 | good = yield candidates |
|
1062 | good = yield candidates |
@@ -271,7 +271,7 b' test maxdeltachainspan' | |||||
271 | 51 17 -1 4 3 50 prev 3?? 5?? 6?? 1.0???? 6?? 0 0.00000 (glob) |
|
271 | 51 17 -1 4 3 50 prev 3?? 5?? 6?? 1.0???? 6?? 0 0.00000 (glob) | |
272 | 52 51 -1 4 4 51 p1 58 640 6?? 1.0???? 6?? 0 0.00000 (glob) |
|
272 | 52 51 -1 4 4 51 p1 58 640 6?? 1.0???? 6?? 0 0.00000 (glob) | |
273 | 53 52 -1 5 1 -1 base 0 0 0 0.00000 0 0 0.00000 |
|
273 | 53 52 -1 5 1 -1 base 0 0 0 0.00000 0 0 0.00000 | |
274 |
54 53 -1 |
|
274 | 54 53 -1 5 2 53 p1 3?? 640 3?? 0.5???? 3?? 0 0.00000 (glob) | |
275 | $ hg clone --pull source-repo --config experimental.maxdeltachainspan=2800 relax-chain --config format.generaldelta=yes |
|
275 | $ hg clone --pull source-repo --config experimental.maxdeltachainspan=2800 relax-chain --config format.generaldelta=yes | |
276 | requesting all changes |
|
276 | requesting all changes | |
277 | adding changesets |
|
277 | adding changesets |
General Comments 0
You need to be logged in to leave comments.
Login now