rust-dirstate: call new "dirs" rust implementation from Python
authorRaphaël Gomès <rgomes@octobus.net>
Wed, 05 Jun 2019 17:58:34 +0200
changeset 42538 2db96bf84a8f
parent 42537 ce94f9622acd
child 42539 5c64d0b4c037
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
mercurial/util.py
--- 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: