Show More
@@ -1055,6 +1055,25 b' class _DeltaSearch(_BaseDeltaSearch):' | |||||
1055 |
|
1055 | |||
1056 | return True |
|
1056 | return True | |
1057 |
|
1057 | |||
|
1058 | def _iter_parents(self): | |||
|
1059 | # exclude already lazy tested base if any | |||
|
1060 | parents = [p for p in (self.p1, self.p2) if p != nullrev] | |||
|
1061 | ||||
|
1062 | self.current_stage = _STAGE_PARENTS | |||
|
1063 | if ( | |||
|
1064 | not self.revlog.delta_config.delta_both_parents | |||
|
1065 | and len(parents) == 2 | |||
|
1066 | ): | |||
|
1067 | parents.sort() | |||
|
1068 | # To minimize the chance of having to build a fulltext, | |||
|
1069 | # pick first whichever parent is closest to us (max rev) | |||
|
1070 | yield (parents[1],) | |||
|
1071 | # then the other one (min rev) if the first did not fit | |||
|
1072 | yield (parents[0],) | |||
|
1073 | elif len(parents) > 0: | |||
|
1074 | # Test all parents (1 or 2), and keep the best candidate | |||
|
1075 | yield parents | |||
|
1076 | ||||
1058 | def _refined_groups(self): |
|
1077 | def _refined_groups(self): | |
1059 | good = None |
|
1078 | good = None | |
1060 | groups = self._raw_groups() |
|
1079 | groups = self._raw_groups() | |
@@ -1107,28 +1126,12 b' class _DeltaSearch(_BaseDeltaSearch):' | |||||
1107 |
|
1126 | |||
1108 | The group order aims at providing fast or small candidates first. |
|
1127 | The group order aims at providing fast or small candidates first. | |
1109 | """ |
|
1128 | """ | |
|
1129 | yield from self._iter_parents() | |||
1110 | sparse = self.revlog.delta_config.sparse_revlog |
|
1130 | sparse = self.revlog.delta_config.sparse_revlog | |
1111 | prev = self.target_rev - 1 |
|
1131 | prev = self.target_rev - 1 | |
1112 | deltachain = lambda rev: self.revlog._deltachain(rev)[0] |
|
1132 | deltachain = lambda rev: self.revlog._deltachain(rev)[0] | |
1113 |
|
1133 | |||
1114 | # exclude already lazy tested base if any |
|
|||
1115 | parents = [p for p in (self.p1, self.p2) if p != nullrev] |
|
1134 | parents = [p for p in (self.p1, self.p2) if p != nullrev] | |
1116 |
|
||||
1117 | self.current_stage = _STAGE_PARENTS |
|
|||
1118 | if ( |
|
|||
1119 | not self.revlog.delta_config.delta_both_parents |
|
|||
1120 | and len(parents) == 2 |
|
|||
1121 | ): |
|
|||
1122 | parents.sort() |
|
|||
1123 | # To minimize the chance of having to build a fulltext, |
|
|||
1124 | # pick first whichever parent is closest to us (max rev) |
|
|||
1125 | yield (parents[1],) |
|
|||
1126 | # then the other one (min rev) if the first did not fit |
|
|||
1127 | yield (parents[0],) |
|
|||
1128 | elif len(parents) > 0: |
|
|||
1129 | # Test all parents (1 or 2), and keep the best candidate |
|
|||
1130 | yield parents |
|
|||
1131 |
|
||||
1132 | if sparse and parents: |
|
1135 | if sparse and parents: | |
1133 | self.current_stage = _STAGE_SNAPSHOT |
|
1136 | self.current_stage = _STAGE_SNAPSHOT | |
1134 | # See if we can use an existing snapshot in the parent chains to |
|
1137 | # See if we can use an existing snapshot in the parent chains to |
General Comments 0
You need to be logged in to leave comments.
Login now