remotefilelog: remove unnecessary file ancestor process

Summary: Remove unnecessary file ancestor process and their cache.

Reviewed By: muirdm

Differential Revision: D45898747

fbshipit-source-id: a540a937f98a63a93a71f5bb3e5befe0a56de1d8
This commit is contained in:
Zhaolong Zhu 2023-05-23 19:31:53 -07:00 committed by Facebook GitHub Bot
parent 7957234b9b
commit c6c3779843

View File

@ -724,23 +724,10 @@ def onetimeclientsetup(ui):
def getrenamedfn(repo, endrev=None):
rcache = {}
def getrenamed(fn, rev):
"""looks up all renames for a file (up to endrev) the first
time the file is given. It indexes on the changerev and only
parses the manifest if linkrev != changerev.
Returns rename info for fn at changerev rev."""
if rev in rcache.setdefault(fn, {}):
return rcache[fn][rev]
"""Returns rename info for fn at changerev rev."""
try:
fctx = repo[rev].filectx(fn)
for ancestor in fctx.ancestors():
if ancestor.path() == fn:
renamed = ancestor.renamed()
rcache[fn][ancestor.rev()] = renamed
return fctx.renamed()
except error.LookupError:
return None