--- a/rust/hg-pyo3/src/dirstate.rs Fri Jan 24 15:58:18 2025 +0100
+++ b/rust/hg-pyo3/src/dirstate.rs Fri Jan 24 16:05:16 2025 +0100
@@ -10,7 +10,7 @@
//! `hg-core` package.
//!
//! From Python, this will be seen as `mercurial.pyo3_rustext.dirstate`
-use crate::utils::new_submodule;
+use crate::{exceptions, utils::new_submodule};
use pyo3::prelude::*;
pub fn init_module<'py>(
@@ -19,5 +19,6 @@
) -> PyResult<Bound<'py, PyModule>> {
let m = new_submodule(py, package, "dirstate")?;
m.add("__doc__", "Dirstate - Rust implementation exposed via PyO3")?;
+ m.add("FallbackError", py.get_type::<exceptions::FallbackError>())?;
Ok(m)
}
--- a/rust/hg-pyo3/src/exceptions.rs Fri Jan 24 15:58:18 2025 +0100
+++ b/rust/hg-pyo3/src/exceptions.rs Fri Jan 24 16:05:16 2025 +0100
@@ -8,6 +8,7 @@
use crate::revision::PyRevision;
create_exception!(pyo3_rustext, GraphError, PyValueError);
+create_exception!(pyo3_rustext, FallbackError, PyRuntimeError);
import_exception!(mercurial.error, WdirUnsupported);
impl GraphError {