changeset 51834:4704c4c79f21

manifest: use `read_delta_parents` when adjusting linkrev in remotefile Let's use the more accurate API.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 01 Aug 2024 13:12:49 +0200
parents a891347058e7
children acc2d0f08fc9
files hgext/remotefilelog/remotefilectx.py
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/remotefilelog/remotefilectx.py	Thu Aug 01 13:10:09 2024 +0200
+++ b/hgext/remotefilelog/remotefilectx.py	Thu Aug 01 13:12:49 2024 +0200
@@ -100,7 +100,11 @@
             if path in data[3]:  # checking the 'files' field.
                 # The file has been touched, check if the hash is what we're
                 # looking for.
-                if fileid == mfl[data[0]].readfast().get(path):
+                #
+                # The change has to be against a parent, otherwise we might be
+                # missing linkrev worthy changes.
+                m = mfl[data[0]].read_delta_parents(exact=False)
+                if fileid == m.get(path):
                     return rev
 
         # Couldn't find the linkrev. This should generally not happen, and will
@@ -199,8 +203,10 @@
         manifestnode, files = ancctx[0], ancctx[3]
         # If the file was touched in this ancestor, and the content is similar
         # to the one we are searching for.
-        if path in files and fnode == mfl[manifestnode].readfast().get(path):
-            return cl.node(ancrev)
+        if path in files:
+            m = mfl[manifestnode].read_delta_parents(exact=False)
+            if fnode == m.get(path):
+                return cl.node(ancrev)
         return None
 
     def _adjustlinknode(self, path, filelog, fnode, srcrev, inclusive=False):