comparison mercurial/revlogutils/flagutil.py @ 42987:36a0a1951d64

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
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 03 Sep 2019 23:51:17 +0200
parents bd5858c28bbe
children f4caf910669e
comparison
equal deleted inserted replaced
42986:33532939c667 42987:36a0a1951d64
118 processed text and ``validatehash`` is a bool indicating whether the 118 processed text and ``validatehash`` is a bool indicating whether the
119 returned text should be checked for hash integrity. 119 returned text should be checked for hash integrity.
120 """ 120 """
121 return self._processflagsfunc(text, flags, 'read') 121 return self._processflagsfunc(text, flags, 'read')
122 122
123 def _processflagswrite(self, text, flags): 123 def _processflagswrite(self, text, flags, sidedata):
124 """Inspect revision data flags and applies write transformations defined 124 """Inspect revision data flags and applies write transformations defined
125 by registered flag processors. 125 by registered flag processors.
126 126
127 ``text`` - the revision data to process 127 ``text`` - the revision data to process
128 ``flags`` - the revision flags 128 ``flags`` - the revision flags
134 134
135 Returns a 2-tuple of ``(text, validatehash)`` where ``text`` is the 135 Returns a 2-tuple of ``(text, validatehash)`` where ``text`` is the
136 processed text and ``validatehash`` is a bool indicating whether the 136 processed text and ``validatehash`` is a bool indicating whether the
137 returned text should be checked for hash integrity. 137 returned text should be checked for hash integrity.
138 """ 138 """
139 assert not sidedata # XXX until it is actually processed
139 return self._processflagsfunc(text, flags, 'write')[:2] 140 return self._processflagsfunc(text, flags, 'write')[:2]
140 141
141 def _processflagsraw(self, text, flags): 142 def _processflagsraw(self, text, flags):
142 """Inspect revision data flags to check is the content hash should be 143 """Inspect revision data flags to check is the content hash should be
143 validated. 144 validated.