rust/hg-cpython/src/dirstate/copymap.rs
changeset 43284 ce6dd1cee4c8
parent 43177 5cb8867c9e2b
child 43285 ffc1fbd7d1f5
equal deleted inserted replaced
43283:96eb9ef777a8 43284:ce6dd1cee4c8
    11 use cpython::{PyBytes, PyClone, PyDict, PyObject, PyResult, Python};
    11 use cpython::{PyBytes, PyClone, PyDict, PyObject, PyResult, Python};
    12 use std::cell::RefCell;
    12 use std::cell::RefCell;
    13 
    13 
    14 use crate::dirstate::dirstate_map::DirstateMap;
    14 use crate::dirstate::dirstate_map::DirstateMap;
    15 use crate::ref_sharing::PyLeakedRef;
    15 use crate::ref_sharing::PyLeakedRef;
       
    16 use hg::DirstateMap as RustDirstateMap;
    16 use hg::{utils::hg_path::HgPathBuf, CopyMapIter};
    17 use hg::{utils::hg_path::HgPathBuf, CopyMapIter};
    17 
    18 
    18 py_class!(pub class CopyMap |py| {
    19 py_class!(pub class CopyMap |py| {
    19     data dirstate_map: DirstateMap;
    20     data dirstate_map: DirstateMap;
    20 
    21 
   102     }
   103     }
   103 }
   104 }
   104 
   105 
   105 py_shared_iterator!(
   106 py_shared_iterator!(
   106     CopyMapKeysIterator,
   107     CopyMapKeysIterator,
   107     PyLeakedRef,
   108     PyLeakedRef<&'static RustDirstateMap>,
   108     CopyMapIter<'static>,
   109     CopyMapIter<'static>,
   109     CopyMap::translate_key,
   110     CopyMap::translate_key,
   110     Option<PyBytes>
   111     Option<PyBytes>
   111 );
   112 );
   112 
   113 
   113 py_shared_iterator!(
   114 py_shared_iterator!(
   114     CopyMapItemsIterator,
   115     CopyMapItemsIterator,
   115     PyLeakedRef,
   116     PyLeakedRef<&'static RustDirstateMap>,
   116     CopyMapIter<'static>,
   117     CopyMapIter<'static>,
   117     CopyMap::translate_key_value,
   118     CopyMap::translate_key_value,
   118     Option<(PyBytes, PyBytes)>
   119     Option<(PyBytes, PyBytes)>
   119 );
   120 );