Show More
@@ -838,7 +838,7 b' class _DeltaSearch(_BaseDeltaSearch):' | |||||
838 | # Why search for delta base if we cannot use a delta base ? |
|
838 | # Why search for delta base if we cannot use a delta base ? | |
839 | # also see issue6056 |
|
839 | # also see issue6056 | |
840 | assert self.revlog.delta_config.general_delta |
|
840 | assert self.revlog.delta_config.general_delta | |
841 |
self._candidates_iterator = self._ |
|
841 | self._candidates_iterator = self._iter_groups() | |
842 | self._last_good = None |
|
842 | self._last_good = None | |
843 | if ( |
|
843 | if ( | |
844 | self.cachedelta is not None |
|
844 | self.cachedelta is not None | |
@@ -1082,13 +1082,13 b' class _DeltaSearch(_BaseDeltaSearch):' | |||||
1082 |
|
1082 | |||
1083 | def _iter_snapshots_base(self): |
|
1083 | def _iter_snapshots_base(self): | |
1084 | assert self.revlog.delta_config.sparse_revlog |
|
1084 | assert self.revlog.delta_config.sparse_revlog | |
|
1085 | assert self.current_stage == _STAGE_SNAPSHOT | |||
1085 | prev = self.target_rev - 1 |
|
1086 | prev = self.target_rev - 1 | |
1086 | deltachain = lambda rev: self.revlog._deltachain(rev)[0] |
|
1087 | deltachain = lambda rev: self.revlog._deltachain(rev)[0] | |
1087 |
|
1088 | |||
1088 | parents = [p for p in (self.p1, self.p2) if p != nullrev] |
|
1089 | parents = [p for p in (self.p1, self.p2) if p != nullrev] | |
1089 | if not parents: |
|
1090 | if not parents: | |
1090 | return |
|
1091 | return | |
1091 | self.current_stage = _STAGE_SNAPSHOT |
|
|||
1092 | # See if we can use an existing snapshot in the parent chains to |
|
1092 | # See if we can use an existing snapshot in the parent chains to | |
1093 | # use as a base for a new intermediate-snapshot |
|
1093 | # use as a base for a new intermediate-snapshot | |
1094 | # |
|
1094 | # | |
@@ -1173,21 +1173,15 b' class _DeltaSearch(_BaseDeltaSearch):' | |||||
1173 | ] |
|
1173 | ] | |
1174 | yield tuple(sorted(full)) |
|
1174 | yield tuple(sorted(full)) | |
1175 |
|
1175 | |||
1176 |
def _ |
|
1176 | def _iter_snapshots(self): | |
|
1177 | assert self.revlog.delta_config.sparse_revlog | |||
|
1178 | self.current_stage = _STAGE_SNAPSHOT | |||
1177 | good = None |
|
1179 | good = None | |
1178 |
groups = self._ |
|
1180 | groups = self._iter_snapshots_base() | |
1179 | for candidates in groups: |
|
1181 | for candidates in groups: | |
1180 | good = yield candidates |
|
1182 | good = yield candidates | |
1181 | if good is not None: |
|
1183 | if good is not None: | |
1182 | break |
|
1184 | break | |
1183 |
|
||||
1184 | # If sparse revlog is enabled, we can try to refine the available |
|
|||
1185 | # deltas |
|
|||
1186 | if not self.revlog.delta_config.sparse_revlog: |
|
|||
1187 | self.current_stage = _STAGE_FULL |
|
|||
1188 | yield None |
|
|||
1189 | return |
|
|||
1190 |
|
||||
1191 | # if we have a refinable value, try to refine it |
|
1185 | # if we have a refinable value, try to refine it | |
1192 | if ( |
|
1186 | if ( | |
1193 | good is not None |
|
1187 | good is not None | |
@@ -1213,23 +1207,27 b' class _DeltaSearch(_BaseDeltaSearch):' | |||||
1213 | sorted(c for c in self.snapshot_cache.snapshots[good]) |
|
1207 | sorted(c for c in self.snapshot_cache.snapshots[good]) | |
1214 | ) |
|
1208 | ) | |
1215 | good = yield children |
|
1209 | good = yield children | |
1216 |
|
||||
1217 | self.current_stage = _STAGE_FULL |
|
|||
1218 | yield None |
|
1210 | yield None | |
1219 |
|
1211 | |||
1220 |
def _r |
|
1212 | def _iter_groups(self): | |
1221 | """Provides group of revision to be tested as delta base |
|
1213 | good = None | |
1222 |
|
1214 | for group in self._iter_parents(): | ||
1223 | This lower level function focus on emitting delta theorically |
|
1215 | good = yield group | |
1224 | interresting without looking it any practical details. |
|
1216 | if good is not None: | |
1225 |
|
1217 | break | ||
1226 | The group order aims at providing fast or small candidates first. |
|
1218 | else: | |
1227 | """ |
|
1219 | assert good is None | |
1228 | yield from self._iter_parents() |
|
|||
1229 | if self.revlog.delta_config.sparse_revlog: |
|
1220 | if self.revlog.delta_config.sparse_revlog: | |
1230 | yield from self._iter_snapshots_base() |
|
1221 | # If sparse revlog is enabled, we can try to refine the | |
|
1222 | # available deltas | |||
|
1223 | iter_snap = self._iter_snapshots() | |||
|
1224 | group = iter_snap.send(None) | |||
|
1225 | while group is not None: | |||
|
1226 | good = yield group | |||
|
1227 | group = iter_snap.send(good) | |||
1231 | else: |
|
1228 | else: | |
1232 | yield from self._iter_prev() |
|
1229 | yield from self._iter_prev() | |
|
1230 | yield None | |||
1233 |
|
1231 | |||
1234 |
|
1232 | |||
1235 | class SnapshotCache: |
|
1233 | class SnapshotCache: |
General Comments 0
You need to be logged in to leave comments.
Login now