Mercurial > public > mercurial-scm > hg
diff mercurial/revlogutils/flagutil.py @ 42988:f4caf910669e
flagprocessors: writetransform function take side data as parameter (API)
If we want some flag processors to be able to store sidedata it needs to be
actually fed that data.
Differential Revision: https://phab.mercurial-scm.org/D6816
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 04 Sep 2019 00:53:27 +0200 |
parents | 36a0a1951d64 |
children | 50d9de61ce02 |
line wrap: on
line diff
--- a/mercurial/revlogutils/flagutil.py Tue Sep 03 23:51:17 2019 +0200 +++ b/mercurial/revlogutils/flagutil.py Wed Sep 04 00:53:27 2019 +0200 @@ -136,8 +136,8 @@ 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] + return self._processflagsfunc(text, flags, 'write', + sidedata=sidedata)[:2] def _processflagsraw(self, text, flags): """Inspect revision data flags to check is the content hash should be @@ -157,7 +157,7 @@ """ return self._processflagsfunc(text, flags, 'raw')[1] - def _processflagsfunc(self, text, flags, operation): + def _processflagsfunc(self, text, flags, operation, sidedata=None): # fast path: no flag processors will run if flags == 0: return text, True, {} @@ -196,7 +196,7 @@ text, vhash, s = readtransform(self, text) outsidedata.update(s) else: # write operation - text, vhash = writetransform(self, text) + text, vhash = writetransform(self, text, sidedata) validatehash = validatehash and vhash return text, validatehash, outsidedata