manifest: use `read_delta_parents` when adjusting linkrev
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 01 Aug 2024 13:15:54 +0200
changeset 51784 9844bab33aee
parent 51783 acc2d0f08fc9
child 51785 bcb825bf0c5e
manifest: use `read_delta_parents` when adjusting linkrev Let's use the more accurate API.
mercurial/context.py
--- a/mercurial/context.py	Thu Aug 01 13:15:10 2024 +0200
+++ b/mercurial/context.py	Thu Aug 01 13:15:54 2024 +0200
@@ -1063,7 +1063,12 @@
                 if path in ac[3]:  # checking the 'files' field.
                     # The file has been touched, check if the content is
                     # similar to the one we search for.
-                    if fnode == mfl[ac[0]].readfast().get(path):
+                    #
+                    # If the content is similar to one of the parents, then it
+                    # cannot be an adjusted linkrev
+                    if fnode == (
+                        mfl[ac[0]].read_delta_parents(exact=False).get(path)
+                    ):
                         return a
             # In theory, we should never get out of that loop without a result.
             # But if manifest uses a buggy file revision (not children of the