diff -r c627f1b2f3c3 -r 443dc1655923 rust/hg-cpython/src/revlog.rs --- a/rust/hg-cpython/src/revlog.rs Thu Dec 12 18:11:44 2019 +0100 +++ b/rust/hg-cpython/src/revlog.rs Thu Dec 12 03:39:14 2019 +0100 @@ -29,6 +29,17 @@ cindex::Index::new(py, cindex)?)) } + /// Compatibility layer used for Python consumers needing access to the C index + /// + /// Only use case so far is `scmutil.shortesthexnodeidprefix`, + /// that may need to build a custom `nodetree`, based on a specified revset. + /// With a Rust implementation of the nodemap, we will be able to get rid of + /// this, by exposing our own standalone nodemap class, + /// ready to accept `MixedIndex`. + def get_cindex(&self) -> PyResult { + Ok(self.cindex(py).borrow().inner().clone_ref(py)) + } + // Reforwarded C index API