diff mercurial/revlogutils/deltas.py @ 50355:0232571255d3 stable

delta-find: never do anything fancy when general delta is off Without general delta, the only option is to do a delta against the previous revision in the revlog, or to do a full snapshot. So no need to dive into the more complicated logic. This prevent Mercurial to misbehave when applying remote deltas when `pulled-delta-reuse-policy` was set to "try-base" or "forced" and would produce and store invalid deltas. We add an associated tests to make sure this scenario is covered by tests. There are more code to cleanup after this, but I what to keep the fixing patch simple.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 19 Apr 2023 18:16:19 +0200
parents ca1522fe4ec8
children 2a6949ab9d23
line wrap: on
line diff
--- a/mercurial/revlogutils/deltas.py	Wed Apr 19 16:59:03 2023 +0200
+++ b/mercurial/revlogutils/deltas.py	Wed Apr 19 18:16:19 2023 +0200
@@ -687,6 +687,12 @@
     if target_rev is None:
         target_rev = len(revlog)
 
+    if not revlog._generaldelta:
+        # before general delta, there is only one possible delta base
+        yield (target_rev - 1,)
+        yield None
+        return
+
     if (
         cachedelta is not None
         and nullrev == cachedelta[0]