Mercurial > hg
comparison rust/hg-cpython/src/dirstate/dirstate_map.rs @ 51618:ccf5c44092db stable
rust-cpython: don't swallow the dirstate error message
In case we do get a dirstate error, we want to get the full error message and
not just an opaque `Dirstate error`.
author | Raphaël Gomès <rgomes@octobus.net> |
---|---|
date | Mon, 06 May 2024 15:30:21 +0200 |
parents | a6b8b1ab9116 |
children |
comparison
equal
deleted
inserted
replaced
51617:f808fa119212 | 51618:ccf5c44092db |
---|---|
268 let packed = PyBytes::new(py, &packed); | 268 let packed = PyBytes::new(py, &packed); |
269 let tree_metadata = PyBytes::new(py, tree_metadata.as_bytes()); | 269 let tree_metadata = PyBytes::new(py, tree_metadata.as_bytes()); |
270 let tuple = (packed, tree_metadata, append); | 270 let tuple = (packed, tree_metadata, append); |
271 Ok(tuple.to_py_object(py).into_object()) | 271 Ok(tuple.to_py_object(py).into_object()) |
272 }, | 272 }, |
273 Err(_) => Err(PyErr::new::<exc::OSError, _>( | 273 Err(e) => Err(PyErr::new::<exc::OSError, _>( |
274 py, | 274 py, |
275 "Dirstate error".to_string(), | 275 e.to_string(), |
276 )), | 276 )), |
277 } | 277 } |
278 } | 278 } |
279 | 279 |
280 def filefoldmapasdict(&self) -> PyResult<PyDict> { | 280 def filefoldmapasdict(&self) -> PyResult<PyDict> { |