diff -r ee1b648e4453 -r ea3343104f07 mercurial/match.py --- a/mercurial/match.py Wed Apr 17 12:28:48 2024 +0200 +++ b/mercurial/match.py Tue Apr 09 11:00:52 2024 +0100 @@ -395,9 +395,15 @@ class basematcher: def __init__(self, badfn=None): + self._was_tampered_with = False if badfn is not None: self.bad = badfn + def was_tampered_with(self): + # [_was_tampered_with] is used to track if when extensions changed the matcher + # behavior (crazy stuff!), so we disable the rust fast path. + return self._was_tampered_with + def __call__(self, fn): return self.matchfn(fn)