# HG changeset patch # User Georges Racinet # Date 1698676353 -3600 # Node ID 8dbd985733ff4954b1bacb764a113330ebbb320e # Parent 41e19e8a613310fec3d63b2a7006cf718e5edc70 rust-cpython-revlog: renamed NodeTree import as CoreNodeTree We're about to introduce a `NodeTree` Python class (hence also a Rust struct) and it would be a collision with the import diff -r 41e19e8a6133 -r 8dbd985733ff rust/hg-cpython/src/revlog.rs --- a/rust/hg-cpython/src/revlog.rs Fri Oct 20 09:48:53 2023 +0200 +++ b/rust/hg-cpython/src/revlog.rs Mon Oct 30 15:32:33 2023 +0100 @@ -24,7 +24,7 @@ IndexHeader, Phase, RevisionDataParams, SnapshotsCache, INDEX_ENTRY_SIZE, }, - nodemap::{Block, NodeMapError, NodeTree}, + nodemap::{Block, NodeMapError, NodeTree as CoreNodeTree}, revlog::{nodemap::NodeMap, Graph, NodePrefix, RevlogError, RevlogIndex}, BaseRevision, Node, Revision, UncheckedRevision, NULL_REVISION, }; @@ -89,7 +89,7 @@ py_class!(pub class MixedIndex |py| { data cindex: RefCell; @shared data index: hg::index::Index; - data nt: RefCell>; + data nt: RefCell>; data docket: RefCell>; // Holds a reference to the mmap'ed persistent nodemap data data nodemap_mmap: RefCell>; @@ -632,7 +632,7 @@ fn fill_nodemap( &self, py: Python, - nt: &mut NodeTree, + nt: &mut CoreNodeTree, ) -> PyResult { let index = self.index(py).borrow(); for r in 0..self.len(py)? { @@ -647,10 +647,10 @@ fn get_nodetree<'a>( &'a self, py: Python<'a>, - ) -> PyResult<&'a RefCell>> { + ) -> PyResult<&'a RefCell>> { if self.nt(py).borrow().is_none() { let readonly = Box::>::default(); - let mut nt = NodeTree::load_bytes(readonly, 0); + let mut nt = CoreNodeTree::load_bytes(readonly, 0); self.fill_nodemap(py, &mut nt)?; self.nt(py).borrow_mut().replace(nt); } @@ -669,7 +669,7 @@ // If there's anything readonly, we need to build the data again from // scratch let bytes = if readonly.len() > 0 { - let mut nt = NodeTree::load_bytes(Box::>::default(), 0); + let mut nt = CoreNodeTree::load_bytes(Box::>::default(), 0); self.fill_nodemap(py, &mut nt)?; let (readonly, bytes) = nt.into_readonly_and_added_bytes(); @@ -719,7 +719,7 @@ let len = buf.item_count(); self.nodemap_mmap(py).borrow_mut().replace(buf); - let mut nt = NodeTree::load_bytes(bytes, len); + let mut nt = CoreNodeTree::load_bytes(bytes, len); let data_tip = docket .getattr(py, "tip_rev")?