diff mercurial/localrepo.py @ 49355:0540c1628fd4

sparse: use None as the sparse matcher value when disabled This create a clear signal for when the feature is unused. We could also create an `alwaysmatcher`, but using None is more explicit, so I went for it.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sat, 11 Jun 2022 00:56:50 +0200
parents 4f04bb0d8deb
children 0c70d888a484 0705afae6253
line wrap: on
line diff
--- a/mercurial/localrepo.py	Wed Jun 08 09:31:01 2022 +0200
+++ b/mercurial/localrepo.py	Sat Jun 11 00:56:50 2022 +0200
@@ -1747,7 +1747,9 @@
 
     def _makedirstate(self):
         """Extension point for wrapping the dirstate per-repo."""
-        sparsematchfn = lambda: sparse.matcher(self)
+        sparsematchfn = None
+        if sparse.use_sparse(self):
+            sparsematchfn = lambda: sparse.matcher(self)
         v2_req = requirementsmod.DIRSTATE_V2_REQUIREMENT
         th = requirementsmod.DIRSTATE_TRACKED_HINT_V1
         use_dirstate_v2 = v2_req in self.requirements