rust/hg-cpython/src/dirstate.rs
changeset 47280 1766130fe9ba
parent 47123 d8ac62374943
child 47539 84391ddf4c78
equal deleted inserted replaced
47279:40b51c28b242 47280:1766130fe9ba
    24 };
    24 };
    25 use cpython::{
    25 use cpython::{
    26     exc, PyBytes, PyDict, PyErr, PyList, PyModule, PyObject, PyResult,
    26     exc, PyBytes, PyDict, PyErr, PyList, PyModule, PyObject, PyResult,
    27     PySequence, Python,
    27     PySequence, Python,
    28 };
    28 };
       
    29 use hg::dirstate_tree::on_disk::V2_FORMAT_MARKER;
    29 use hg::{utils::hg_path::HgPathBuf, DirstateEntry, EntryState, StateMap};
    30 use hg::{utils::hg_path::HgPathBuf, DirstateEntry, EntryState, StateMap};
    30 use libc::{c_char, c_int};
    31 use libc::{c_char, c_int};
    31 use std::convert::TryFrom;
    32 use std::convert::TryFrom;
    32 
    33 
    33 // C code uses a custom `dirstate_tuple` type, checks in multiple instances
    34 // C code uses a custom `dirstate_tuple` type, checks in multiple instances
   115         "FallbackError",
   116         "FallbackError",
   116         py.get_type::<exceptions::FallbackError>(),
   117         py.get_type::<exceptions::FallbackError>(),
   117     )?;
   118     )?;
   118     m.add_class::<Dirs>(py)?;
   119     m.add_class::<Dirs>(py)?;
   119     m.add_class::<DirstateMap>(py)?;
   120     m.add_class::<DirstateMap>(py)?;
       
   121     m.add(py, "V2_FORMAT_MARKER", PyBytes::new(py, V2_FORMAT_MARKER))?;
   120     m.add(
   122     m.add(
   121         py,
   123         py,
   122         "status",
   124         "status",
   123         py_fn!(
   125         py_fn!(
   124             py,
   126             py,