Patchwork D6395: rust-dirstate: call new "dirs" rust implementation from Python

login
register
mail settings
Submitter phabricator
Date June 27, 2019, 1:17 p.m.
Message ID <131cb68186d8a1fdbadbabfd0df53169@localhost.localdomain>
Download mbox | patch
Permalink /patch/40689/
State Not Applicable
Headers show

Comments

phabricator - June 27, 2019, 1:17 p.m.
Alphare updated this revision to Diff 15672.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6395?vs=15509&id=15672

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6395/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6395

AFFECTED FILES
  mercurial/util.py
  rust/hg-core/src/dirstate/dirs_multiset.rs

CHANGE DETAILS




To: Alphare, #hg-reviewers, kevincox
Cc: durin42, kevincox, mercurial-devel

Patch

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
@@ -118,7 +118,9 @@ 
                     entry.remove();
                 }
                 Entry::Vacant(_) => {
-                    return Err(DirstateMapError::PathNotFound(path.to_owned()))
+                    return Err(DirstateMapError::PathNotFound(
+                        path.to_owned(),
+                    ))
                 }
             };
 
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: