# HG changeset patch # User Pierre-Yves David # Date 1654899985 -7200 # Node ID c2092612c424e581cf69a0b8d895efce8409a424 # Parent bd3519dc6741703f6786b59e6c10201f63f95992 sparse: use the rust code even when sparse is present With rust supporting more matcher types, we can now take this route in the sparse case too. diff -r bd3519dc6741 -r c2092612c424 mercurial/dirstate.py --- a/mercurial/dirstate.py Fri Jun 10 23:19:04 2022 +0200 +++ b/mercurial/dirstate.py Sat Jun 11 00:26:25 2022 +0200 @@ -1178,6 +1178,10 @@ return results def _rust_status(self, matcher, list_clean, list_ignored, list_unknown): + if self._sparsematchfn is not None: + em = matchmod.exact(matcher.files()) + sm = matchmod.unionmatcher([self._sparsematcher, em]) + matcher = matchmod.intersectmatchers(matcher, sm) # Force Rayon (Rust parallelism library) to respect the number of # workers. This is a temporary workaround until Rust code knows # how to read the config file. @@ -1296,8 +1300,6 @@ use_rust = False elif subrepos: use_rust = False - elif self._sparsematchfn is not None: - use_rust = False elif not isinstance(match, allowed_matchers): # Some matchers have yet to be implemented use_rust = False