comparison mercurial/revlogutils/deltas.py @ 49611:2afee2176775

delta-find: expand a function definition and call before extendin it This make the next changeset more compact.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 06 Nov 2022 13:46:08 -0500
parents 35d4c2124073
children e706bb41fdb3
comparison
equal deleted inserted replaced
49610:35d4c2124073 49611:2afee2176775
653 # text's, it is very unlikely that it will produce a valid delta. We no longer 653 # text's, it is very unlikely that it will produce a valid delta. We no longer
654 # consider these candidates. 654 # consider these candidates.
655 LIMIT_BASE2TEXT = 500 655 LIMIT_BASE2TEXT = 500
656 656
657 657
658 def _candidategroups(revlog, textlen, p1, p2, cachedelta): 658 def _candidategroups(
659 revlog,
660 textlen,
661 p1,
662 p2,
663 cachedelta,
664 ):
659 """Provides group of revision to be tested as delta base 665 """Provides group of revision to be tested as delta base
660 666
661 This top level function focus on emitting groups with unique and worthwhile 667 This top level function focus on emitting groups with unique and worthwhile
662 content. See _raw_candidate_groups for details about the group order. 668 content. See _raw_candidate_groups for details about the group order.
663 """ 669 """
1167 msg = b"DBG-DELTAS-SEARCH: SEARCH rev=%d\n" 1173 msg = b"DBG-DELTAS-SEARCH: SEARCH rev=%d\n"
1168 msg %= target_rev 1174 msg %= target_rev
1169 self._write_debug(msg) 1175 self._write_debug(msg)
1170 1176
1171 groups = _candidategroups( 1177 groups = _candidategroups(
1172 self.revlog, revinfo.textlen, p1r, p2r, cachedelta 1178 self.revlog,
1179 revinfo.textlen,
1180 p1r,
1181 p2r,
1182 cachedelta,
1173 ) 1183 )
1174 candidaterevs = next(groups) 1184 candidaterevs = next(groups)
1175 while candidaterevs is not None: 1185 while candidaterevs is not None:
1176 dbg_try_rounds += 1 1186 dbg_try_rounds += 1
1177 if debug_search: 1187 if debug_search: