D7654: rust-index: add a `inner` method to the Index struct

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Fri Dec 13 20:12:06 UTC 2019


marmoute created this revision.
Herald added subscribers: mercurial-devel, kevincox, durin42.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  We are about to introduce a Rust wrapper to the C index. It will be exposed as a
  Python object. As a start all call will be forwarded to an internal index object
  (as used now).
  
  For this forwarding to works, we need to access that index object (from the C
  extensions). We adds a method doing to on the existing `Index` rust struct.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7654

AFFECTED FILES
  rust/hg-cpython/src/cindex.rs

CHANGE DETAILS

diff --git a/rust/hg-cpython/src/cindex.rs b/rust/hg-cpython/src/cindex.rs
--- a/rust/hg-cpython/src/cindex.rs
+++ b/rust/hg-cpython/src/cindex.rs
@@ -68,6 +68,11 @@
             parents: get_parents_capi::retrieve(py)?,
         })
     }
+
+    /// return a reference to the CPython Index object in this Struct
+    pub fn inner(&self) -> &PyObject {
+        &self.index
+    }
 }
 
 impl Clone for Index {



To: marmoute, #hg-reviewers
Cc: durin42, kevincox, mercurial-devel


More information about the Mercurial-devel mailing list