##// 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 self.call_cindex(py, "commonancestorsheads", args, kw)
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 def clearcaches(&self, *args, **kw) -> PyResult<PyObject> {
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 self.call_cindex(py, "clearcaches", args, kw)
170 self.call_cindex(py, "clearcaches", args, kw)
167 }
171 }
168
172
@@ -231,7 +235,7 b' py_class!(pub class MixedIndex |py| {'
231 // `index_getitem` does not handle conversion from PyLong,
235 // `index_getitem` does not handle conversion from PyLong,
232 // which expressions such as [e for e in index] internally use.
236 // which expressions such as [e for e in index] internally use.
233 // Note that we don't seem to have a direct way to call
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 // for performance
239 // for performance
236 let key = match key.extract::<Revision>(py) {
240 let key = match key.extract::<Revision>(py) {
237 Ok(rev) => rev.to_py_object(py).into_object(),
241 Ok(rev) => rev.to_py_object(py).into_object(),
General Comments 0
You need to be logged in to leave comments. Login now