# HG changeset patch # User Pierre-Yves David # Date 1567547477 -7200 # Node ID 36a0a1951d64e0184de19dd65151f2d8423ddbf0 # Parent 33532939c667d450ca5637daeeca9d02889b17c8 flagprocessors: add a `sidedata` parameters to _processflagswrite To read sidedata using flagprocessors, we need flag processors to store them. So we pass this information to the flag processing layer. Differential Revision: https://phab.mercurial-scm.org/D6815 diff -r 33532939c667 -r 36a0a1951d64 hgext/remotefilelog/remotefilelog.py --- a/hgext/remotefilelog/remotefilelog.py Tue Sep 03 23:51:34 2019 +0200 +++ b/hgext/remotefilelog/remotefilelog.py Tue Sep 03 23:51:17 2019 +0200 @@ -138,7 +138,8 @@ sidedata = {} meta, metaoffset = storageutil.parsemeta(text) - rawtext, validatehash = self._processflagswrite(text, flags) + rawtext, validatehash = self._processflagswrite(text, flags, + sidedata=sidedata) return self.addrawrevision(rawtext, transaction, linknode, p1, p2, node, flags, cachedelta, _metatuple=(meta, metaoffset)) diff -r 33532939c667 -r 36a0a1951d64 mercurial/revlog.py --- a/mercurial/revlog.py Tue Sep 03 23:51:34 2019 +0200 +++ b/mercurial/revlog.py Tue Sep 03 23:51:17 2019 +0200 @@ -1842,7 +1842,8 @@ if flags: node = node or self.hash(text, p1, p2) - rawtext, validatehash = self._processflagswrite(text, flags) + rawtext, validatehash = self._processflagswrite(text, flags, + sidedata=sidedata) # If the flag processor modifies the revision data, ignore any provided # cachedelta. diff -r 33532939c667 -r 36a0a1951d64 mercurial/revlogutils/flagutil.py --- a/mercurial/revlogutils/flagutil.py Tue Sep 03 23:51:34 2019 +0200 +++ b/mercurial/revlogutils/flagutil.py Tue Sep 03 23:51:17 2019 +0200 @@ -120,7 +120,7 @@ """ return self._processflagsfunc(text, flags, 'read') - def _processflagswrite(self, text, flags): + def _processflagswrite(self, text, flags, sidedata): """Inspect revision data flags and applies write transformations defined by registered flag processors. @@ -136,6 +136,7 @@ processed text and ``validatehash`` is a bool indicating whether the returned text should be checked for hash integrity. """ + assert not sidedata # XXX until it is actually processed return self._processflagsfunc(text, flags, 'write')[:2] def _processflagsraw(self, text, flags):