Show More
@@ -661,6 +661,8 b' def _candidategroups(' | |||||
661 | p1, |
|
661 | p1, | |
662 | p2, |
|
662 | p2, | |
663 | cachedelta, |
|
663 | cachedelta, | |
|
664 | excluded_bases=None, | |||
|
665 | target_rev=None, | |||
664 | ): |
|
666 | ): | |
665 | """Provides group of revision to be tested as delta base |
|
667 | """Provides group of revision to be tested as delta base | |
666 |
|
668 | |||
@@ -706,6 +708,13 b' def _candidategroups(' | |||||
706 | if rev in tested: |
|
708 | if rev in tested: | |
707 | continue |
|
709 | continue | |
708 | tested.add(rev) |
|
710 | tested.add(rev) | |
|
711 | # an higher authority deamed the base unworthy (e.g. censored) | |||
|
712 | if excluded_bases is not None and rev in excluded_bases: | |||
|
713 | continue | |||
|
714 | # We are in some recomputation cases and that rev is too high in | |||
|
715 | # the revlog | |||
|
716 | if target_rev is not None and rev >= target_rev: | |||
|
717 | continue | |||
709 | # filter out delta base that will never produce good delta |
|
718 | # filter out delta base that will never produce good delta | |
710 | if deltas_limit < revlog.length(rev): |
|
719 | if deltas_limit < revlog.length(rev): | |
711 | continue |
|
720 | continue | |
@@ -1180,6 +1189,8 b' class deltacomputer:' | |||||
1180 | p1r, |
|
1189 | p1r, | |
1181 | p2r, |
|
1190 | p2r, | |
1182 | cachedelta, |
|
1191 | cachedelta, | |
|
1192 | excluded_bases, | |||
|
1193 | target_rev, | |||
1183 | ) |
|
1194 | ) | |
1184 | candidaterevs = next(groups) |
|
1195 | candidaterevs = next(groups) | |
1185 | while candidaterevs is not None: |
|
1196 | while candidaterevs is not None: | |
@@ -1243,16 +1254,7 b' class deltacomputer:' | |||||
1243 | msg = b"DBG-DELTAS-SEARCH: base=%d\n" |
|
1254 | msg = b"DBG-DELTAS-SEARCH: base=%d\n" | |
1244 | msg %= self.revlog.deltaparent(candidaterev) |
|
1255 | msg %= self.revlog.deltaparent(candidaterev) | |
1245 | self._write_debug(msg) |
|
1256 | self._write_debug(msg) | |
1246 | if candidaterev in excluded_bases: |
|
1257 | ||
1247 | if debug_search: |
|
|||
1248 | msg = b"DBG-DELTAS-SEARCH: EXCLUDED\n" |
|
|||
1249 | self._write_debug(msg) |
|
|||
1250 | continue |
|
|||
1251 | if candidaterev >= target_rev: |
|
|||
1252 | if debug_search: |
|
|||
1253 | msg = b"DBG-DELTAS-SEARCH: TOO-HIGH\n" |
|
|||
1254 | self._write_debug(msg) |
|
|||
1255 | continue |
|
|||
1256 | dbg_try_count += 1 |
|
1258 | dbg_try_count += 1 | |
1257 |
|
1259 | |||
1258 | if debug_search: |
|
1260 | if debug_search: |
@@ -159,7 +159,7 b' Test `debug-delta-find`' | |||||
159 | 4971 4970 -1 3 5 4930 snap 19179 346472 427596 1.23414 15994877 15567281 36.40652 427596 179288 1.00000 5 |
|
159 | 4971 4970 -1 3 5 4930 snap 19179 346472 427596 1.23414 15994877 15567281 36.40652 427596 179288 1.00000 5 | |
160 | $ hg debug-delta-find SPARSE-REVLOG-TEST-FILE 4971 |
|
160 | $ hg debug-delta-find SPARSE-REVLOG-TEST-FILE 4971 | |
161 | DBG-DELTAS-SEARCH: SEARCH rev=4971 |
|
161 | DBG-DELTAS-SEARCH: SEARCH rev=4971 | |
162 |
DBG-DELTAS-SEARCH: ROUND #1 - |
|
162 | DBG-DELTAS-SEARCH: ROUND #1 - 1 candidates - search-down | |
163 | DBG-DELTAS-SEARCH: CANDIDATE: rev=4962 |
|
163 | DBG-DELTAS-SEARCH: CANDIDATE: rev=4962 | |
164 | DBG-DELTAS-SEARCH: type=snapshot-4 |
|
164 | DBG-DELTAS-SEARCH: type=snapshot-4 | |
165 | DBG-DELTAS-SEARCH: size=18296 |
|
165 | DBG-DELTAS-SEARCH: size=18296 | |
@@ -167,11 +167,6 b' Test `debug-delta-find`' | |||||
167 | DBG-DELTAS-SEARCH: uncompressed-delta-size=30377 |
|
167 | DBG-DELTAS-SEARCH: uncompressed-delta-size=30377 | |
168 | DBG-DELTAS-SEARCH: delta-search-time=* (glob) |
|
168 | DBG-DELTAS-SEARCH: delta-search-time=* (glob) | |
169 | DBG-DELTAS-SEARCH: DELTA: length=16872 (BAD) |
|
169 | DBG-DELTAS-SEARCH: DELTA: length=16872 (BAD) | |
170 | DBG-DELTAS-SEARCH: CANDIDATE: rev=4971 |
|
|||
171 | DBG-DELTAS-SEARCH: type=snapshot-4 |
|
|||
172 | DBG-DELTAS-SEARCH: size=19179 |
|
|||
173 | DBG-DELTAS-SEARCH: base=4930 |
|
|||
174 | DBG-DELTAS-SEARCH: TOO-HIGH |
|
|||
175 | DBG-DELTAS-SEARCH: ROUND #2 - 1 candidates - search-down |
|
170 | DBG-DELTAS-SEARCH: ROUND #2 - 1 candidates - search-down | |
176 | DBG-DELTAS-SEARCH: CANDIDATE: rev=4930 |
|
171 | DBG-DELTAS-SEARCH: CANDIDATE: rev=4930 | |
177 | DBG-DELTAS-SEARCH: type=snapshot-3 |
|
172 | DBG-DELTAS-SEARCH: type=snapshot-3 |
General Comments 0
You need to be logged in to leave comments.
Login now