rust/hg-cpython/src/dirstate.rs
changeset 47539 84391ddf4c78
parent 47280 1766130fe9ba
child 47567 7a15dea6d303
equal deleted inserted replaced
47538:77fce401a2bb 47539:84391ddf4c78
    36 // Because this type differs only in name from the regular Python tuple, it
    36 // Because this type differs only in name from the regular Python tuple, it
    37 // would be a good idea in the near future to remove it entirely to allow
    37 // would be a good idea in the near future to remove it entirely to allow
    38 // for a pure Python tuple of the same effective structure to be used,
    38 // for a pure Python tuple of the same effective structure to be used,
    39 // rendering this type and the capsule below useless.
    39 // rendering this type and the capsule below useless.
    40 py_capsule_fn!(
    40 py_capsule_fn!(
    41     from mercurial.cext.parsers import make_dirstate_tuple_CAPI
    41     from mercurial.cext.parsers import make_dirstate_item_CAPI
    42         as make_dirstate_tuple_capi
    42         as make_dirstate_item_capi
    43         signature (
    43         signature (
    44             state: c_char,
    44             state: c_char,
    45             mode: c_int,
    45             mode: c_int,
    46             size: c_int,
    46             size: c_int,
    47             mtime: c_int,
    47             mtime: c_int,
    48         ) -> *mut RawPyObject
    48         ) -> *mut RawPyObject
    49 );
    49 );
    50 
    50 
    51 pub fn make_dirstate_tuple(
    51 pub fn make_dirstate_item(
    52     py: Python,
    52     py: Python,
    53     entry: &DirstateEntry,
    53     entry: &DirstateEntry,
    54 ) -> PyResult<PyObject> {
    54 ) -> PyResult<PyObject> {
    55     // might be silly to retrieve capsule function in hot loop
    55     // might be silly to retrieve capsule function in hot loop
    56     let make = make_dirstate_tuple_capi::retrieve(py)?;
    56     let make = make_dirstate_item_capi::retrieve(py)?;
    57 
    57 
    58     let &DirstateEntry {
    58     let &DirstateEntry {
    59         state,
    59         state,
    60         mode,
    60         mode,
    61         size,
    61         size,