mercurial/localrepo.py
branchstable
changeset 50316 87f0155d68aa
parent 50301 9fc0d244a753
child 50323 6901916458bd
--- a/mercurial/localrepo.py	Mon Mar 20 11:40:18 2023 +0100
+++ b/mercurial/localrepo.py	Mon Mar 20 11:52:17 2023 +0100
@@ -1240,7 +1240,12 @@
         if path.startswith(b'/'):
             path = path[1:]
 
-        return filelog.filelog(self.svfs, path)
+        try_split = (
+            self.currenttransaction() is not None
+            or txnutil.mayhavepending(self.root)
+        )
+
+        return filelog.filelog(self.svfs, path, try_split=try_split)
 
 
 @interfaceutil.implementer(repository.ilocalrepositoryfilestorage)
@@ -1251,7 +1256,13 @@
         if path.startswith(b'/'):
             path = path[1:]
 
-        return filelog.narrowfilelog(self.svfs, path, self._storenarrowmatch)
+        try_split = (
+            self.currenttransaction() is not None
+            or txnutil.mayhavepending(self.root)
+        )
+        return filelog.narrowfilelog(
+            self.svfs, path, self._storenarrowmatch, try_split=try_split
+        )
 
 
 def makefilestorage(requirements, features, **kwargs):