Mercurial > public > mercurial-scm > hg
diff rust/hg-cpython/src/dirstate/dirstate_map.rs @ 48020:1194394510ba
rust: Remove the `rustext.parsers` module
It only exported Rust implementations of the parse_dirstate and pack_dirtate
functions, which are only used (anymore) when Rust is not enabled.
fakedirstatewritetime.py was detecting the presence of `rustext.parsers`
but what it really wants to know is whether the Rust implementation of
`dirstatemap` is used. This changes it to detect `rustext.dirstate` instead.
Differential Revision: https://phab.mercurial-scm.org/D11459
author | Simon Sapin <simon.sapin@octobus.net> |
---|---|
date | Mon, 20 Sep 2021 12:52:32 +0200 |
parents | 4afd6cc447b9 |
children | f2a9db29cb2d |
line wrap: on
line diff
--- a/rust/hg-cpython/src/dirstate/dirstate_map.rs Fri Sep 17 14:36:54 2021 +0200 +++ b/rust/hg-cpython/src/dirstate/dirstate_map.rs Mon Sep 20 12:52:32 2021 +0200 @@ -24,7 +24,6 @@ dirstate::non_normal_entries::{ NonNormalEntries, NonNormalEntriesIterator, }, - parsers::dirstate_parents_to_pytuple, pybytes_deref::PyBytesDeref, }; use hg::{ @@ -79,7 +78,11 @@ (Box::new(map) as _, parents) }; let map = Self::create_instance(py, inner)?; - let parents = parents.map(|p| dirstate_parents_to_pytuple(py, &p)); + let parents = parents.map(|p| { + let p1 = PyBytes::new(py, p.p1.as_bytes()); + let p2 = PyBytes::new(py, p.p2.as_bytes()); + (p1, p2) + }); Ok((map, parents).to_py_object(py).into_object()) }