diff -r 99296ca9f29e -r 8bc14ac53a41 mercurial/localrepo.py --- a/mercurial/localrepo.py Thu Feb 23 04:02:38 2023 +0100 +++ b/mercurial/localrepo.py Thu Feb 23 04:15:16 2023 +0100 @@ -1469,6 +1469,8 @@ # post-dirstate-status hooks self._postdsstatus = [] + self._pending_narrow_pats = None + # generic mapping between names and nodes self.names = namespaces.namespaces() @@ -1799,7 +1801,11 @@ A tuple of (includes, excludes). """ - return narrowspec.load(self) + # the narrow management should probably move into its own object + val = self._pending_narrow_pats + if val is None: + val = narrowspec.load(self) + return val @storecache(narrowspec.FILENAME) def _storenarrowmatch(self):