equal
deleted
inserted
replaced
14 mod dirstate_map; |
14 mod dirstate_map; |
15 mod item; |
15 mod item; |
16 mod status; |
16 mod status; |
17 use self::item::DirstateItem; |
17 use self::item::DirstateItem; |
18 use crate::{ |
18 use crate::{ |
19 dirstate::{ |
19 dirstate::{dirs_multiset::Dirs, status::status_wrapper}, |
20 dirs_multiset::Dirs, dirstate_map::DirstateMap, status::status_wrapper, |
|
21 }, |
|
22 exceptions, |
20 exceptions, |
23 }; |
21 }; |
24 use cpython::{PyBytes, PyDict, PyList, PyModule, PyObject, PyResult, Python}; |
22 use cpython::{PyBytes, PyDict, PyList, PyModule, PyObject, PyResult, Python}; |
|
23 use dirstate_map::{DirstateIdentity, DirstateMap}; |
25 use hg::dirstate_tree::on_disk::V2_FORMAT_MARKER; |
24 use hg::dirstate_tree::on_disk::V2_FORMAT_MARKER; |
26 |
25 |
27 /// Create the module, with `__package__` given from parent |
26 /// Create the module, with `__package__` given from parent |
28 pub fn init_module(py: Python, package: &str) -> PyResult<PyModule> { |
27 pub fn init_module(py: Python, package: &str) -> PyResult<PyModule> { |
29 let dotted_name = &format!("{}.dirstate", package); |
28 let dotted_name = &format!("{}.dirstate", package); |
40 py.get_type::<exceptions::FallbackError>(), |
39 py.get_type::<exceptions::FallbackError>(), |
41 )?; |
40 )?; |
42 m.add_class::<Dirs>(py)?; |
41 m.add_class::<Dirs>(py)?; |
43 m.add_class::<DirstateMap>(py)?; |
42 m.add_class::<DirstateMap>(py)?; |
44 m.add_class::<DirstateItem>(py)?; |
43 m.add_class::<DirstateItem>(py)?; |
|
44 m.add_class::<DirstateIdentity>(py)?; |
45 m.add(py, "V2_FORMAT_MARKER", PyBytes::new(py, V2_FORMAT_MARKER))?; |
45 m.add(py, "V2_FORMAT_MARKER", PyBytes::new(py, V2_FORMAT_MARKER))?; |
46 m.add( |
46 m.add( |
47 py, |
47 py, |
48 "status", |
48 "status", |
49 py_fn!( |
49 py_fn!( |