Mercurial > public > mercurial-scm > hg
comparison mercurial/context.py @ 51780:9844bab33aee
manifest: use `read_delta_parents` when adjusting linkrev
Let's use the more accurate API.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 01 Aug 2024 13:15:54 +0200 |
parents | 87a8190e66fe |
children | f4733654f144 |
comparison
equal
deleted
inserted
replaced
51779:acc2d0f08fc9 | 51780:9844bab33aee |
---|---|
1061 return None | 1061 return None |
1062 ac = cl.read(a) # get changeset data (we avoid object creation) | 1062 ac = cl.read(a) # get changeset data (we avoid object creation) |
1063 if path in ac[3]: # checking the 'files' field. | 1063 if path in ac[3]: # checking the 'files' field. |
1064 # The file has been touched, check if the content is | 1064 # The file has been touched, check if the content is |
1065 # similar to the one we search for. | 1065 # similar to the one we search for. |
1066 if fnode == mfl[ac[0]].readfast().get(path): | 1066 # |
1067 # If the content is similar to one of the parents, then it | |
1068 # cannot be an adjusted linkrev | |
1069 if fnode == ( | |
1070 mfl[ac[0]].read_delta_parents(exact=False).get(path) | |
1071 ): | |
1067 return a | 1072 return a |
1068 # In theory, we should never get out of that loop without a result. | 1073 # In theory, we should never get out of that loop without a result. |
1069 # But if manifest uses a buggy file revision (not children of the | 1074 # But if manifest uses a buggy file revision (not children of the |
1070 # one it replaces) we could. Such a buggy situation will likely | 1075 # one it replaces) we could. Such a buggy situation will likely |
1071 # result is crash somewhere else at to some point. | 1076 # result is crash somewhere else at to some point. |