Mercurial > public > mercurial-scm > hg-stable
diff rust/hg-cpython/src/revlog.rs @ 47078:d57386e5c80e
revlog: have an explicit "pack_header" method
Having to pass the version header when retrieving the binary version of every
single entry is a bit silly. So we extract that special logic in its own method.
This also prepare the move to newer revlog format, not storing the header within
an actual entry?
Differential Revision: https://phab.mercurial-scm.org/D10510
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 01 Apr 2021 11:31:54 +0200 |
parents | 0d8ff1f4ab0c |
children | 9d1a8829f959 |
line wrap: on
line diff
--- a/rust/hg-cpython/src/revlog.rs Sat May 01 14:47:39 2021 +0200 +++ b/rust/hg-cpython/src/revlog.rs Thu Apr 01 11:31:54 2021 +0200 @@ -177,6 +177,11 @@ self.call_cindex(py, "entry_binary", args, kw) } + /// return a binary packed version of the header + def pack_header(&self, *args, **kw) -> PyResult<PyObject> { + self.call_cindex(py, "pack_header", args, kw) + } + /// get an index entry def get(&self, *args, **kw) -> PyResult<PyObject> { self.call_cindex(py, "get", args, kw)