mercurial/match.py
changeset 51601 ea3343104f07
parent 51569 b32c3146ec34
child 51603 a2afa35641c9
--- 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)