remotefilelog: check if RFL is enabled in getrenamedfn() override
In
8a0e03f7baf4 (remotefilelog: move most setup from onetimesetup() to
uisetup(), 2019-05-01), I said:
All the wrappers moved in this patch check if remotefilelog is enabled
before they change behavior, so it's safe to always wrap.
That was clearly a lie, because getrenamedfn() didn't. That made
e.g. `hg log -T {file_copies}` unbearably slow. This patch fixes that.
Differential Revision: https://phab.mercurial-scm.org/D6541
--- a/hgext/remotefilelog/__init__.py Tue Jun 18 08:55:23 2019 -0700
+++ b/hgext/remotefilelog/__init__.py Wed Jun 19 11:12:06 2019 -0700
@@ -316,7 +316,7 @@
scmutil.fileprefetchhooks.add('remotefilelog', _fileprefetchhook)
# disappointing hacks below
- scmutil.getrenamedfn = getrenamedfn
+ extensions.wrapfunction(scmutil, 'getrenamedfn', getrenamedfn)
extensions.wrapfunction(revset, 'filelog', filelogrevset)
revset.symbols['filelog'] = revset.filelog
extensions.wrapfunction(cmdutil, 'walkfilerevs', walkfilerevs)
@@ -635,7 +635,10 @@
return node
extensions.wrapfunction(changelog.changelog, 'add', changelogadd)
-def getrenamedfn(repo, endrev=None):
+def getrenamedfn(orig, repo, endrev=None):
+ if not isenabled(repo):
+ return orig(repo, endrev)
+
rcache = {}
def getrenamed(fn, rev):