rust-dirstate: call new "dirs" rust implementation from Python
This is a simple module attribute replacement, will take precedence over the
Python and C implementations.
Differential Revision: https://phab.mercurial-scm.org/D6395
--- a/mercurial/util.py Thu May 16 18:03:42 2019 +0200
+++ b/mercurial/util.py Wed Jun 05 17:58:34 2019 +0200
@@ -53,6 +53,8 @@
stringutil,
)
+rustdirs = policy.importrust('dirstate', 'Dirs')
+
base85 = policy.importmod(r'base85')
osutil = policy.importmod(r'osutil')
parsers = policy.importmod(r'parsers')
@@ -3204,6 +3206,9 @@
if safehasattr(parsers, 'dirs'):
dirs = parsers.dirs
+if rustdirs is not None:
+ dirs = rustdirs
+
def finddirs(path):
pos = path.rfind('/')
while pos != -1: