diff -r cf6e1d535602 -r 87f0155d68aa mercurial/localrepo.py --- 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):