# HG changeset patch # User Georges Racinet # Date 2023-10-30 20:25:28 # Node ID 8b243e2a3bc435b5196f11cdfb74cc13e6bcb432 # Parent 8dbd985733ff4954b1bacb764a113330ebbb320e rust-index: a property to identify the Rust index as such Will be useful soon in `mercurial.scmutil` and potentially elsewhere diff --git a/rust/hg-cpython/src/revlog.rs b/rust/hg-cpython/src/revlog.rs --- a/rust/hg-cpython/src/revlog.rs +++ b/rust/hg-cpython/src/revlog.rs @@ -14,9 +14,9 @@ use crate::{ use cpython::{ buffer::{Element, PyBuffer}, exc::{IndexError, ValueError}, - ObjectProtocol, PyBytes, PyClone, PyDict, PyErr, PyInt, PyList, PyModule, - PyObject, PyResult, PySet, PyString, PyTuple, Python, PythonObject, - ToPyObject, UnsafePyLeaked, + ObjectProtocol, PyBool, PyBytes, PyClone, PyDict, PyErr, PyInt, PyList, + PyModule, PyObject, PyResult, PySet, PyString, PyTuple, Python, + PythonObject, ToPyObject, UnsafePyLeaked, }; use hg::{ errors::HgError, @@ -451,6 +451,11 @@ py_class!(pub class MixedIndex |py| { Ok(rust_res) } + @property + def is_rust(&self) -> PyResult { + Ok(false.to_py_object(py)) + } + }); /// Take a (potentially) mmap'ed buffer, and return the underlying Python