# HG changeset patch # User Raphaël Gomès # Date 2019-06-05 15:58:34 # Node ID 2db96bf84a8f3f99e664fce5d9b25dde9e91a93b # Parent ce94f9622acd56f23cc20da20afda3908531f49a 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 diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -53,6 +53,8 @@ from .utils import ( 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 @@ class dirs(object): if safehasattr(parsers, 'dirs'): dirs = parsers.dirs +if rustdirs is not None: + dirs = rustdirs + def finddirs(path): pos = path.rfind('/') while pos != -1: