mirror of
https://github.com/facebook/sapling.git
synced 2024-10-05 14:28:17 +03:00
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:
parent
7957234b9b
commit
c6c3779843
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user