equal
deleted
inserted
replaced
25 data cindex: RefCell<cindex::Index>; |
25 data cindex: RefCell<cindex::Index>; |
26 |
26 |
27 def __new__(_cls, cindex: PyObject) -> PyResult<MixedIndex> { |
27 def __new__(_cls, cindex: PyObject) -> PyResult<MixedIndex> { |
28 Self::create_instance(py, RefCell::new( |
28 Self::create_instance(py, RefCell::new( |
29 cindex::Index::new(py, cindex)?)) |
29 cindex::Index::new(py, cindex)?)) |
|
30 } |
|
31 |
|
32 /// Compatibility layer used for Python consumers needing access to the C index |
|
33 /// |
|
34 /// Only use case so far is `scmutil.shortesthexnodeidprefix`, |
|
35 /// that may need to build a custom `nodetree`, based on a specified revset. |
|
36 /// With a Rust implementation of the nodemap, we will be able to get rid of |
|
37 /// this, by exposing our own standalone nodemap class, |
|
38 /// ready to accept `MixedIndex`. |
|
39 def get_cindex(&self) -> PyResult<PyObject> { |
|
40 Ok(self.cindex(py).borrow().inner().clone_ref(py)) |
30 } |
41 } |
31 |
42 |
32 |
43 |
33 // Reforwarded C index API |
44 // Reforwarded C index API |
34 |
45 |