--- a/mercurial/match.py Tue Jan 14 18:03:28 2020 +0100
+++ b/mercurial/match.py Tue Jan 14 16:58:07 2020 +0100
@@ -24,7 +24,7 @@
)
from .utils import stringutil
-rustmod = policy.importrust('filepatterns')
+rustmod = policy.importrust('dirstate')
allpatternkinds = (
b're',
@@ -1273,15 +1273,6 @@
'''Convert a (normalized) pattern of any kind into a
regular expression.
globsuffix is appended to the regexp of globs.'''
-
- if rustmod is not None:
- try:
- return rustmod.build_single_regex(kind, pat, globsuffix)
- except rustmod.PatternError:
- raise error.ProgrammingError(
- b'not a regex pattern: %s:%s' % (kind, pat)
- )
-
if not pat and kind in (b'glob', b'relpath'):
return b''
if kind == b're':
@@ -1554,18 +1545,6 @@
This is useful to debug ignore patterns.
'''
- if rustmod is not None:
- result, warnings = rustmod.read_pattern_file(
- filepath, bool(warn), sourceinfo,
- )
-
- for warning_params in warnings:
- # Can't be easily emitted from Rust, because it would require
- # a mechanism for both gettext and calling the `warn` function.
- warn(_(b"%s: ignoring invalid syntax '%s'\n") % warning_params)
-
- return result
-
syntaxes = {
b're': b'relre:',
b'regexp': b'relre:',