##// END OF EJS Templates
rust-nodemap: also clear Rust data in `clearcaches`...
Georges Racinet -
r44998:cadcc8c2 default
parent child Browse files
Show More
@@ -161,8 +161,12 b' py_class!(pub class MixedIndex |py| {'
161 161 self.call_cindex(py, "commonancestorsheads", args, kw)
162 162 }
163 163
164 /// clear the index caches
164 /// Clear the index caches and inner py_class data.
165 /// It is Python's responsibility to call `update_nodemap_data` again.
165 166 def clearcaches(&self, *args, **kw) -> PyResult<PyObject> {
167 self.nt(py).borrow_mut().take();
168 self.docket(py).borrow_mut().take();
169 self.mmap(py).borrow_mut().take();
166 170 self.call_cindex(py, "clearcaches", args, kw)
167 171 }
168 172
@@ -231,7 +235,7 b' py_class!(pub class MixedIndex |py| {'
231 235 // `index_getitem` does not handle conversion from PyLong,
232 236 // which expressions such as [e for e in index] internally use.
233 237 // Note that we don't seem to have a direct way to call
234 // PySequence_GetItem (does the job), which would be better for
238 // PySequence_GetItem (does the job), which would possibly be better
235 239 // for performance
236 240 let key = match key.extract::<Revision>(py) {
237 241 Ok(rev) => rev.to_py_object(py).into_object(),
General Comments 0
You need to be logged in to leave comments. Login now