comparison rust/hg-cpython/src/lib.rs @ 43961:b69d5f3a41d0

rust-index: add a struct wrapping the C index Implementing the full index logic in one go is journey larger than we would like. To achieve a smoother transition, we start with a simple Rust wrapper that delegates allwork to the current C implementation. Once we will have a fully working index object in Rust, we can easily start using more and more Rust Code with it. The object in this patch is functional and tested. However, multiple of the currently existing rust (in the `hg-cpython` crate) requires a `Graph`. Right now we build this `Graph` (as cindex::Index) using the C index passed as a PyObject. They will have to be updated to be made compatible. Differential Revision: https://phab.mercurial-scm.org/D7655
author Georges Racinet <georges.racinet@octobus.net>
date Mon, 23 Dec 2019 10:02:50 -0800
parents f98f0e3ddaa1
children 3bd77c64bc74
comparison
equal deleted inserted replaced
43960:ab3fd8077f5e 43961:b69d5f3a41d0
48 let dotted_name: String = m.get(py, "__name__")?.extract(py)?; 48 let dotted_name: String = m.get(py, "__name__")?.extract(py)?;
49 m.add(py, "ancestor", ancestors::init_module(py, &dotted_name)?)?; 49 m.add(py, "ancestor", ancestors::init_module(py, &dotted_name)?)?;
50 m.add(py, "dagop", dagops::init_module(py, &dotted_name)?)?; 50 m.add(py, "dagop", dagops::init_module(py, &dotted_name)?)?;
51 m.add(py, "discovery", discovery::init_module(py, &dotted_name)?)?; 51 m.add(py, "discovery", discovery::init_module(py, &dotted_name)?)?;
52 m.add(py, "dirstate", dirstate::init_module(py, &dotted_name)?)?; 52 m.add(py, "dirstate", dirstate::init_module(py, &dotted_name)?)?;
53 m.add(py, "revlog", revlog::init_module(py, &dotted_name)?)?;
53 m.add( 54 m.add(
54 py, 55 py,
55 "filepatterns", 56 "filepatterns",
56 filepatterns::init_module(py, &dotted_name)?, 57 filepatterns::init_module(py, &dotted_name)?,
57 )?; 58 )?;