mercurial/localrepo.py
changeset 39765 3e801ffd7269
parent 39764 e4e881572382
child 39770 7aa440222323
--- a/mercurial/localrepo.py	Tue Sep 18 15:29:42 2018 -0700
+++ b/mercurial/localrepo.py	Thu Sep 13 16:02:22 2018 -0700
@@ -743,9 +743,22 @@
 
         return filelog.filelog(self.svfs, path)
 
+@interfaceutil.implementer(repository.ilocalrepositoryfilestorage)
+class revlognarrowfilestorage(object):
+    """File storage when using revlogs and narrow files."""
+
+    def file(self, path):
+        if path[0] == b'/':
+            path = path[1:]
+
+        return filelog.narrowfilelog(self.svfs, path, self.narrowmatch())
+
 def makefilestorage(requirements, **kwargs):
     """Produce a type conforming to ``ilocalrepositoryfilestorage``."""
-    return revlogfilestorage
+    if repository.NARROW_REQUIREMENT in requirements:
+        return revlognarrowfilestorage
+    else:
+        return revlogfilestorage
 
 # List of repository interfaces and factory functions for them. Each
 # will be called in order during ``makelocalrepository()`` to iteratively