rust/hg-cpython/src/revlog.rs
changeset 44503 887d0f921b34
parent 44070 451d22174b5f
child 44506 26dd35ac59b8
equal deleted inserted replaced
44502:166349510398 44503:887d0f921b34
    26 
    26 
    27 py_class!(pub class MixedIndex |py| {
    27 py_class!(pub class MixedIndex |py| {
    28     data cindex: RefCell<cindex::Index>;
    28     data cindex: RefCell<cindex::Index>;
    29 
    29 
    30     def __new__(_cls, cindex: PyObject) -> PyResult<MixedIndex> {
    30     def __new__(_cls, cindex: PyObject) -> PyResult<MixedIndex> {
    31         Self::create_instance(py, RefCell::new(
    31         Self::new(py, cindex)
    32             cindex::Index::new(py, cindex)?))
       
    33     }
    32     }
    34 
    33 
    35     /// Compatibility layer used for Python consumers needing access to the C index
    34     /// Compatibility layer used for Python consumers needing access to the C index
    36     ///
    35     ///
    37     /// Only use case so far is `scmutil.shortesthexnodeidprefix`,
    36     /// Only use case so far is `scmutil.shortesthexnodeidprefix`,
   197 
   196 
   198 
   197 
   199 });
   198 });
   200 
   199 
   201 impl MixedIndex {
   200 impl MixedIndex {
       
   201     fn new(py: Python, cindex: PyObject) -> PyResult<MixedIndex> {
       
   202         Self::create_instance(
       
   203             py,
       
   204             RefCell::new(cindex::Index::new(py, cindex)?),
       
   205         )
       
   206     }
       
   207 
   202     /// forward a method call to the underlying C index
   208     /// forward a method call to the underlying C index
   203     fn call_cindex(
   209     fn call_cindex(
   204         &self,
   210         &self,
   205         py: Python,
   211         py: Python,
   206         name: &str,
   212         name: &str,