comparison rust/hg-cpython/src/revlog.rs @ 51464:68ed56baabf5 stable

rust-index: don't use mutable borrow to computed filtered heads This does not need to mutate the index. This is the prime suspect for some RuntimeError raised during some pushes.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 05 Mar 2024 15:07:47 +0100
parents a43a6d4b3be6
children fb4d49c52c06
comparison
equal deleted inserted replaced
51463:a43a6d4b3be6 51464:68ed56baabf5
871 fn inner_headrevsfiltered( 871 fn inner_headrevsfiltered(
872 &self, 872 &self,
873 py: Python, 873 py: Python,
874 filtered_revs: &PyObject, 874 filtered_revs: &PyObject,
875 ) -> PyResult<PyObject> { 875 ) -> PyResult<PyObject> {
876 let index = &mut *self.index(py).borrow_mut(); 876 let index = &*self.index(py).borrow();
877 let filtered_revs = rev_pyiter_collect(py, filtered_revs, index)?; 877 let filtered_revs = rev_pyiter_collect(py, filtered_revs, index)?;
878 878
879 if let Some(new_heads) = index 879 if let Some(new_heads) = index
880 .head_revs_filtered(&filtered_revs, true) 880 .head_revs_filtered(&filtered_revs, true)
881 .map_err(|e| graph_error(py, e))? 881 .map_err(|e| graph_error(py, e))?