# HG changeset patch # User Raphaël Gomès # Date 2019-11-29 16:30:57 # Node ID 40fd1ef4e4c154a4895a494a07f82c663597c44b # Parent 6a88ced33c40531494c42e5f535a5d714cd122b1 rust-matchers: add support for `exactmatcher` in `dirstate.status` `exactmatcher` is the name in the Python implementation and corresponds to `FileMatcher` in Rust. Differential Revision: https://phab.mercurial-scm.org/D7531 diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -1107,11 +1107,14 @@ class dirstate(object): dmap.preload() use_rust = True + + allowed_matchers = (matchmod.alwaysmatcher, matchmod.exactmatcher) + if rustmod is None: use_rust = False elif subrepos: use_rust = False - if bool(listunknown): + elif bool(listunknown): # Pathauditor does not exist yet in Rust, unknown files # can't be trusted. use_rust = False @@ -1119,7 +1122,7 @@ class dirstate(object): # Rust has no ignore mechanism yet, so don't use Rust for # commands that need ignore. use_rust = False - elif not match.always(): + elif not isinstance(match, allowed_matchers): # Matchers have yet to be implemented use_rust = False @@ -1147,6 +1150,7 @@ class dirstate(object): clean, ) = rustmod.status( dmap._rustmap, + match, self._rootdir, bool(listclean), self._lastnormaltime,