Mercurial > public > mercurial-scm > hg-stable
diff mercurial/cext/revlog.c @ 47095:223b47235d1c
sidedata: enable sidedata computers to optionally rewrite flags
Sidedata computers may want to influence the flags of the revision they touch.
For example, the computer for changelog-based copytracing can add a flag to
signify that this revision might affect copytracing, inversely removing said
flag if the information is no longer applicable.
See inline documentation in `storageutil` for more details.
Differential Revision: https://phab.mercurial-scm.org/D10344
author | Rapha?l Gom?s <rgomes@octobus.net> |
---|---|
date | Thu, 08 Apr 2021 16:55:17 +0200 |
parents | d57386e5c80e |
children | c55afa35a5c8 |
line wrap: on
line diff
--- a/mercurial/cext/revlog.c Sat Apr 10 11:27:40 2021 +0200 +++ b/mercurial/cext/revlog.c Thu Apr 08 16:55:17 2021 +0200 @@ -503,14 +503,14 @@ inside the transaction that creates the given revision. */ static PyObject *index_replace_sidedata_info(indexObject *self, PyObject *args) { - uint64_t sidedata_offset; + uint64_t offset_flags, sidedata_offset; int rev; Py_ssize_t sidedata_comp_len; char *data; #if LONG_MAX == 0x7fffffffL - const char *const sidedata_format = PY23("nKi", "nKi"); + const char *const sidedata_format = PY23("nKiK", "nKiK"); #else - const char *const sidedata_format = PY23("nki", "nki"); + const char *const sidedata_format = PY23("nkik", "nkik"); #endif if (self->hdrsize == v1_hdrsize || self->inlined) { @@ -525,7 +525,7 @@ } if (!PyArg_ParseTuple(args, sidedata_format, &rev, &sidedata_offset, - &sidedata_comp_len)) + &sidedata_comp_len, &offset_flags)) return NULL; if (rev < 0 || rev >= index_length(self)) { @@ -542,6 +542,7 @@ /* Find the newly added node, offset from the "already on-disk" length */ data = self->added + self->hdrsize * (rev - self->length); + putbe64(offset_flags, data); putbe64(sidedata_offset, data + 64); putbe32(sidedata_comp_len, data + 72);