rust/hg-cpython/src/dirstate/status.rs
changeset 45861 c9c3c277e5a5
parent 45610 496537c9c1b4
child 47093 787ff5d21bcd
equal deleted inserted replaced
45860:073bb7563931 45861:c9c3c277e5a5
     8 //! Bindings for the `hg::status` module provided by the
     8 //! Bindings for the `hg::status` module provided by the
     9 //! `hg-core` crate. From Python, this will be seen as
     9 //! `hg-core` crate. From Python, this will be seen as
    10 //! `rustext.dirstate.status`.
    10 //! `rustext.dirstate.status`.
    11 
    11 
    12 use crate::{dirstate::DirstateMap, exceptions::FallbackError};
    12 use crate::{dirstate::DirstateMap, exceptions::FallbackError};
       
    13 use cpython::exc::OSError;
    13 use cpython::{
    14 use cpython::{
    14     exc::ValueError, ObjectProtocol, PyBytes, PyErr, PyList, PyObject,
    15     exc::ValueError, ObjectProtocol, PyBytes, PyErr, PyList, PyObject,
    15     PyResult, PyTuple, Python, PythonObject, ToPyObject,
    16     PyResult, PyTuple, Python, PythonObject, ToPyObject,
    16 };
    17 };
    17 use hg::{
    18 use hg::{
    87             let as_string = e.to_string();
    88             let as_string = e.to_string();
    88             log::trace!("Rust status fallback: `{}`", &as_string);
    89             log::trace!("Rust status fallback: `{}`", &as_string);
    89 
    90 
    90             PyErr::new::<FallbackError, _>(py, &as_string)
    91             PyErr::new::<FallbackError, _>(py, &as_string)
    91         }
    92         }
       
    93         StatusError::IO(e) => PyErr::new::<OSError, _>(py, e.to_string()),
    92         e => PyErr::new::<ValueError, _>(py, e.to_string()),
    94         e => PyErr::new::<ValueError, _>(py, e.to_string()),
    93     }
    95     }
    94 }
    96 }
    95 
    97 
    96 pub fn status_wrapper(
    98 pub fn status_wrapper(