delta-find: move target_rev in the _DeltaSearch.__init__
Now that we have an object we can initialize that attribute at initialization
time.
--- a/mercurial/revlogutils/deltas.py Mon Nov 20 05:03:21 2023 +0100
+++ b/mercurial/revlogutils/deltas.py Mon Nov 20 05:04:23 2023 +0100
@@ -699,6 +699,8 @@
self.p2 = p2
self.cachedelta = cachedelta
self.excluded_bases = excluded_bases
+ if target_rev is None:
+ self.target_rev = len(self.revlog)
self.target_rev = target_rev
if snapshot_cache is None:
# map: base-rev: [snapshot-revs]
@@ -717,9 +719,6 @@
yield None
return
- if self.target_rev is None:
- self.target_rev = len(self.revlog)
-
if not self.revlog.delta_config.general_delta:
# before general delta, there is only one possible delta base
yield (self.target_rev - 1,)