diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -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: diff --git a/rust/Cargo.lock b/rust/Cargo.lock --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -1,3 +1,5 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. [[package]] name = "aho-corasick" version = "0.6.9" diff --git a/rust/hg-core/src/dirstate/dirs_multiset.rs b/rust/hg-core/src/dirstate/dirs_multiset.rs --- a/rust/hg-core/src/dirstate/dirs_multiset.rs +++ b/rust/hg-core/src/dirstate/dirs_multiset.rs @@ -117,7 +117,9 @@ entry.remove(); } Entry::Vacant(_) => { - return Err(DirstateMapError::PathNotFound(path.to_owned())) + return Err(DirstateMapError::PathNotFound( + path.to_owned(), + )) } };