Mercurial > public > mercurial-scm > hg
diff mercurial/revlogutils/deltas.py @ 49612:e706bb41fdb3
delta-find: move pre-filtering with other pre-filtering logic
This is more consistent and will help use to be in a clean state before dealing
with the "too large group" issue.
As a side effect, the debug output now skip some useless cases, making it more useful.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sun, 06 Nov 2022 12:51:50 -0500 |
parents | 2afee2176775 |
children | 5447c1507c86 |
line wrap: on
line diff
--- a/mercurial/revlogutils/deltas.py Sun Nov 06 13:46:08 2022 -0500 +++ b/mercurial/revlogutils/deltas.py Sun Nov 06 12:51:50 2022 -0500 @@ -661,6 +661,8 @@ p1, p2, cachedelta, + excluded_bases=None, + target_rev=None, ): """Provides group of revision to be tested as delta base @@ -706,6 +708,13 @@ if rev in tested: continue tested.add(rev) + # an higher authority deamed the base unworthy (e.g. censored) + if excluded_bases is not None and rev in excluded_bases: + continue + # We are in some recomputation cases and that rev is too high in + # the revlog + if target_rev is not None and rev >= target_rev: + continue # filter out delta base that will never produce good delta if deltas_limit < revlog.length(rev): continue @@ -1180,6 +1189,8 @@ p1r, p2r, cachedelta, + excluded_bases, + target_rev, ) candidaterevs = next(groups) while candidaterevs is not None: @@ -1243,16 +1254,7 @@ msg = b"DBG-DELTAS-SEARCH: base=%d\n" msg %= self.revlog.deltaparent(candidaterev) self._write_debug(msg) - if candidaterev in excluded_bases: - if debug_search: - msg = b"DBG-DELTAS-SEARCH: EXCLUDED\n" - self._write_debug(msg) - continue - if candidaterev >= target_rev: - if debug_search: - msg = b"DBG-DELTAS-SEARCH: TOO-HIGH\n" - self._write_debug(msg) - continue + dbg_try_count += 1 if debug_search: