Mercurial > hg
diff rust/hg-cpython/src/dirstate/item.rs @ 48045:32ef647821b2
dirstate: Skip no-op conversion in Rust DirstateMap::set_v1
Now that the `DirstateItem` python class is implemented in Rust containing
a `DirstateEntry` value, use that value directly instead of reconstructing
it from v1 data.
Also rename from `set_v1` since dirstate-v1 data is not used anymore.
Differential Revision: https://phab.mercurial-scm.org/D11487
author | Simon Sapin <simon.sapin@octobus.net> |
---|---|
date | Wed, 22 Sep 2021 18:21:58 +0200 |
parents | 3e69bef2031a |
children | 98c0408324e6 |
line wrap: on
line diff
--- a/rust/hg-cpython/src/dirstate/item.rs Wed Sep 22 11:33:29 2021 +0200 +++ b/rust/hg-cpython/src/dirstate/item.rs Wed Sep 22 18:21:58 2021 +0200 @@ -180,6 +180,10 @@ Ok(DirstateItem::create_instance(py, Cell::new(entry))?.into_object()) } + pub fn get_entry(&self, py: Python<'_>) -> DirstateEntry { + self.entry(py).get() + } + // TODO: Use https://doc.rust-lang.org/std/cell/struct.Cell.html#method.update instead when it’s stable pub fn update(&self, py: Python<'_>, f: impl FnOnce(&mut DirstateEntry)) { let mut entry = self.entry(py).get();