diff mercurial/dirstate.py @ 49356:a87443d4aec0

sparse: directly inline the `walk` wrapping core is already aware of sparse, so lets move the handful of line of code that deal with it in `dirstate.walk` for the sake of simplicity.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sat, 11 Jun 2022 00:58:41 +0200
parents 0540c1628fd4
children 5b7a10ddb42f
line wrap: on
line diff
--- a/mercurial/dirstate.py	Sat Jun 11 00:56:50 2022 +0200
+++ b/mercurial/dirstate.py	Sat Jun 11 00:58:41 2022 +0200
@@ -984,6 +984,11 @@
             ignore = util.always
             dirignore = util.always
 
+        if self._sparsematchfn is not None:
+            em = matchmod.exact(match.files())
+            sm = matchmod.unionmatcher([self._sparsematcher, em])
+            match = matchmod.intersectmatchers(match, sm)
+
         matchfn = match.matchfn
         matchalways = match.always()
         matchtdir = match.traversedir