Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/revlogutils/deltas.py @ 51336:01db705bbe32
delta-find: move tested in the _DeltaSearch.__init__
Now that we have an object we can initialize that attribute at initialization
time. This will make it available for more method in the future, allowing to
split the code.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 23 Nov 2023 01:13:40 +0100 |
parents | c9ab452e5611 |
children | a4af7507fa4b |
comparison
equal
deleted
inserted
replaced
51335:c9ab452e5611 | 51336:01db705bbe32 |
---|---|
713 if snapshot_cache is None: | 713 if snapshot_cache is None: |
714 # map: base-rev: [snapshot-revs] | 714 # map: base-rev: [snapshot-revs] |
715 snapshot_cache = SnapshotCache() | 715 snapshot_cache = SnapshotCache() |
716 self.snapshot_cache = snapshot_cache | 716 self.snapshot_cache = snapshot_cache |
717 | 717 |
718 self.tested = {nullrev} | |
719 | |
718 def candidate_groups(self): | 720 def candidate_groups(self): |
719 """Provides group of revision to be tested as delta base | 721 """Provides group of revision to be tested as delta base |
720 | 722 |
721 This top level function focus on emitting groups with unique and | 723 This top level function focus on emitting groups with unique and |
722 worthwhile content. See _raw_candidate_groups for details about the | 724 worthwhile content. See _raw_candidate_groups for details about the |
739 good = None | 741 good = None |
740 | 742 |
741 deltas_limit = self.textlen * LIMIT_DELTA2TEXT | 743 deltas_limit = self.textlen * LIMIT_DELTA2TEXT |
742 group_chunk_size = self.revlog.delta_config.candidate_group_chunk_size | 744 group_chunk_size = self.revlog.delta_config.candidate_group_chunk_size |
743 | 745 |
744 tested = {nullrev} | 746 tested = self.tested # prefetch for speed and code compactness |
745 candidates = self._refined_groups() | 747 candidates = self._refined_groups() |
746 while True: | 748 while True: |
747 temptative = candidates.send(good) | 749 temptative = candidates.send(good) |
748 if temptative is None: | 750 if temptative is None: |
749 break | 751 break |