Mercurial > public > mercurial-scm > hg
diff rust/hg-cpython/src/dirstate/status.rs @ 43915:8c77826116f7
rust-dirstate-status: add `walk_explicit` implementation, use `Matcher` trait
This is the first time we actually use the `Matcher` trait, still for a small
subset of all matchers defined in Python.
While I haven't yet actually measured the performance of this, I have tried
to avoid any unnecessary allocations. This forces the use of heavy lifetimes
annotations which I am not sure we can simplify, although I would be happy
to be proven wrong.
Differential Revision: https://phab.mercurial-scm.org/D7529
author | Rapha?l Gom?s <rgomes@octobus.net> |
---|---|
date | Fri, 29 Nov 2019 17:29:06 +0100 |
parents | ce088b38f92b |
children | 6a88ced33c40 |
line wrap: on
line diff
--- a/rust/hg-cpython/src/dirstate/status.rs Fri Nov 29 18:54:06 2019 +0100 +++ b/rust/hg-cpython/src/dirstate/status.rs Fri Nov 29 17:29:06 2019 +0100 @@ -17,6 +17,7 @@ }; use hg::utils::files::get_path_from_bytes; +use hg::matchers::AlwaysMatcher; use hg::status; use hg::utils::hg_path::HgPath; @@ -53,9 +54,19 @@ let dmap: DirstateMap = dmap.to_py_object(py); let dmap = dmap.get_inner(py); - let (lookup, status_res) = - status(&dmap, &root_dir, list_clean, last_normal_time, check_exec) - .map_err(|e| PyErr::new::<ValueError, _>(py, e.to_string()))?; + // TODO removed in the next patch to get the code to compile. This patch + // is part of a series and does not make real sense on its own. + let matcher = AlwaysMatcher; + + let (lookup, status_res) = status( + &dmap, + &matcher, + &root_dir, + list_clean, + last_normal_time, + check_exec, + ) + .map_err(|e| PyErr::new::<ValueError, _>(py, e.to_string()))?; let modified = collect_pybytes_list(py, status_res.modified.as_ref()); let added = collect_pybytes_list(py, status_res.added.as_ref());