diff rust/hg-cpython/src/dirstate.rs @ 42754:4e8f504424f3

rust-dirstate: rust-cpython bridge for dirstatemap This change also showcases the limitations of the `py_shared_ref!` macro. See the previous commit 'rust-dirstate: rust implementation of dirstatemap` for an explanation for the TODOs in the code. Differential Revision: https://phab.mercurial-scm.org/D6633
author Rapha?l Gom?s <rgomes@octobus.net>
date Wed, 10 Jul 2019 09:56:53 +0200
parents 7ceded4419a3
children 7a01778bc7b7
line wrap: on
line diff
--- a/rust/hg-cpython/src/dirstate.rs	Wed Jul 10 09:56:23 2019 +0200
+++ b/rust/hg-cpython/src/dirstate.rs	Wed Jul 10 09:56:53 2019 +0200
@@ -9,8 +9,10 @@
 //! `hg-core` package.
 //!
 //! From Python, this will be seen as `mercurial.rustext.dirstate`
+mod copymap;
 mod dirs_multiset;
-use crate::dirstate::dirs_multiset::Dirs;
+mod dirstate_map;
+use crate::dirstate::{dirs_multiset::Dirs, dirstate_map::DirstateMap};
 use cpython::{
     exc, PyBytes, PyDict, PyErr, PyModule, PyObject, PyResult, PySequence,
     Python,
@@ -94,6 +96,7 @@
     m.add(py, "__doc__", "Dirstate - Rust implementation")?;
 
     m.add_class::<Dirs>(py)?;
+    m.add_class::<DirstateMap>(py)?;
 
     let sys = PyModule::import(py, "sys")?;
     let sys_modules: PyDict = sys.get(py, "modules")?.extract(py)?;