changeset 51466:a43a6d4b3be6 stable

rust-index: don't use mutable borrow for head-diff computation It does not needs to mutate the index. This is one of the two suspects of RuntimeError being thrown during push.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 05 Mar 2024 15:07:04 +0100
parents 89cd0dd41e4d
children 68ed56baabf5
files rust/hg-cpython/src/revlog.rs
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rust/hg-cpython/src/revlog.rs	Thu Feb 29 14:13:21 2024 -0800
+++ b/rust/hg-cpython/src/revlog.rs	Tue Mar 05 15:07:04 2024 +0100
@@ -854,7 +854,7 @@
     ) -> PyResult<PyObject> {
         let begin = begin.extract::<BaseRevision>(py)?;
         let end = end.extract::<BaseRevision>(py)?;
-        let index = &mut *self.index(py).borrow_mut();
+        let index = &*self.index(py).borrow();
         let begin =
             Self::check_revision(index, UncheckedRevision(begin - 1), py)?;
         let end = Self::check_revision(index, UncheckedRevision(end - 1), py)?;