[Updated] D10960: rust-dirstatemap: expand the wrapping code a bit
marmoute (Pierre-Yves David)
phabricator at mercurial-scm.org
Tue Jul 6 19:09:35 UTC 2021
Closed by commit rHGf6f25ab6bfc8: rust-dirstatemap: expand the wrapping code a bit (authored by marmoute).
This revision was automatically updated to reflect the committed changes.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D10960?vs=28862&id=28899
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D10960/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D10960
AFFECTED FILES
rust/hg-cpython/src/dirstate/dirstate_map.rs
CHANGE DETAILS
diff --git a/rust/hg-cpython/src/dirstate/dirstate_map.rs b/rust/hg-cpython/src/dirstate/dirstate_map.rs
--- a/rust/hg-cpython/src/dirstate/dirstate_map.rs
+++ b/rust/hg-cpython/src/dirstate/dirstate_map.rs
@@ -112,23 +112,31 @@
size: PyObject,
mtime: PyObject
) -> PyResult<PyObject> {
+ let f = f.extract::<PyBytes>(py)?;
+ let filename = HgPath::new(f.data(py));
+ let oldstate = oldstate.extract::<PyBytes>(py)?.data(py)[0]
+ .try_into()
+ .map_err(|e: HgError| {
+ PyErr::new::<exc::ValueError, _>(py, e.to_string())
+ })?;
+ let state = state.extract::<PyBytes>(py)?.data(py)[0]
+ .try_into()
+ .map_err(|e: HgError| {
+ PyErr::new::<exc::ValueError, _>(py, e.to_string())
+ })?;
+ let mode = mode.extract(py)?;
+ let size = size.extract(py)?;
+ let mtime = mtime.extract(py)?;
+ let entry = DirstateEntry {
+ state: state,
+ mode: mode,
+ size: size,
+ mtime: mtime,
+ };
self.inner(py).borrow_mut().add_file(
- HgPath::new(f.extract::<PyBytes>(py)?.data(py)),
- oldstate.extract::<PyBytes>(py)?.data(py)[0]
- .try_into()
- .map_err(|e: HgError| {
- PyErr::new::<exc::ValueError, _>(py, e.to_string())
- })?,
- DirstateEntry {
- state: state.extract::<PyBytes>(py)?.data(py)[0]
- .try_into()
- .map_err(|e: HgError| {
- PyErr::new::<exc::ValueError, _>(py, e.to_string())
- })?,
- mode: mode.extract(py)?,
- size: size.extract(py)?,
- mtime: mtime.extract(py)?,
- },
+ filename,
+ oldstate,
+ entry,
).and(Ok(py.None())).or_else(|e: DirstateError| {
Err(PyErr::new::<exc::ValueError, _>(py, e.to_string()))
})
To: marmoute, #hg-reviewers, SimonSapin, pulkit
Cc: SimonSapin, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210706/99729ab5/attachment-0002.html>
More information about the Mercurial-patches
mailing list