diff rust/hg-cpython/src/revlog.rs @ 52884:8de68446a5bd

index: remember the generaldelta config instead of getting it from the revlog The code (especially the Rust code) was jumping in 4 dimensions to make sense of what was going on because it wrongly assumed that we needed to somehow be able to ask a generaldelta index for a non-generaldelta delta chain, which doesn't make any sense. Removing the cargo-culted/vestigial code, this is cleaner and less confusing.
author Rapha?l Gom?s <rgomes@octobus.net>
date Thu, 13 Feb 2025 13:13:05 +0100
parents 2fb13c3f4496
children
line wrap: on
line diff
--- a/rust/hg-cpython/src/revlog.rs	Thu Feb 13 13:10:11 2025 +0100
+++ b/rust/hg-cpython/src/revlog.rs	Thu Feb 13 13:13:05 2025 +0100
@@ -923,14 +923,11 @@
     }
 
     def _deltachain(&self, *args, **kw) -> PyResult<PyObject> {
-        let inner = self.inner(py).borrow();
-        let general_delta = inner.index.uses_generaldelta();
         let args = PyTuple::new(
             py,
             &[
                 args.get_item(py, 0),
                 kw.and_then(|d| d.get_item(py, "stoprev")).to_py_object(py),
-                general_delta.to_py_object(py).into_object(),
             ]
         );
         self._index_deltachain(py, &args, kw)
@@ -1394,11 +1391,8 @@
                 nodemap_error(py, NodeMapError::RevisionNotInIndex(stop_rev))
             })?)
         } else {None};
-        let using_general_delta = args.get_item(py, 2)
-            .extract::<Option<u32>>(py)?
-            .map(|i| i != 0);
         let (chain, stopped) = index.delta_chain(
-            rev, stop_rev, using_general_delta
+            rev, stop_rev
         ).map_err(|e| {
             PyErr::new::<cpython::exc::ValueError, _>(py, e.to_string())
         })?;