Patchwork D6541: remotefilelog: check if RFL is enabled in getrenamedfn() override

login
register
mail settings
Submitter phabricator
Date June 19, 2019, 9:55 p.m.
Message ID <5bae0984cb92e6259f65c878a4bb6ccb@localhost.localdomain>
Download mbox | patch
Permalink /patch/40610/
State Not Applicable
Headers show

Comments

phabricator - June 19, 2019, 9:55 p.m.
Closed by commit rHGf93762f251d2: remotefilelog: check if RFL is enabled in getrenamedfn() override (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6541?vs=15591&id=15603

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6541/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6541

AFFECTED FILES
  hgext/remotefilelog/__init__.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers, pulkit
Cc: mercurial-devel

Patch

diff --git a/hgext/remotefilelog/__init__.py b/hgext/remotefilelog/__init__.py
--- a/hgext/remotefilelog/__init__.py
+++ b/hgext/remotefilelog/__init__.py
@@ -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):