Mercurial > public > mercurial-scm > hg
diff mercurial/localrepo.py @ 47078: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 | 5554aacd783f |
children | 81eb7091c494 |
line wrap: on
line diff
--- a/mercurial/localrepo.py Sat Apr 10 11:27:40 2021 +0200 +++ b/mercurial/localrepo.py Thu Apr 08 16:55:17 2021 +0200 @@ -3370,9 +3370,9 @@ return self._wanted_sidedata.add(pycompat.bytestr(category)) - def register_sidedata_computer(self, kind, category, keys, computer): + def register_sidedata_computer(self, kind, category, keys, computer, flags): if kind not in revlogconst.ALL_KINDS: - msg = _(b"unexpected revlog kind %r.") + msg = _(b"unexpected revlog kind '%s'.") raise error.ProgrammingError(msg % kind) category = pycompat.bytestr(category) if category in self._sidedata_computers.get(kind, []): @@ -3381,7 +3381,7 @@ ) raise error.ProgrammingError(msg % category) self._sidedata_computers.setdefault(kind, {}) - self._sidedata_computers[kind][category] = (keys, computer) + self._sidedata_computers[kind][category] = (keys, computer, flags) # used to avoid circular references so destructors work