changeset 42985:a45d670c2bfc

flagprocessors: return sidedata map in `_processflagsread` Right now, flag processors does not return sidedata, by they will. So, we prepare the caller to receive it. Differential Revision: https://phab.mercurial-scm.org/D6811
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 03 Sep 2019 22:55:04 +0200
parents 9d62f9fa332f
children 66dc5a522f37
files hgext/remotefilelog/remotefilelog.py mercurial/revlog.py mercurial/revlogutils/flagutil.py tests/simplestorerepo.py
diffstat 4 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/remotefilelog/remotefilelog.py	Tue Sep 03 22:36:41 2019 +0200
+++ b/hgext/remotefilelog/remotefilelog.py	Tue Sep 03 22:55:04 2019 +0200
@@ -324,7 +324,7 @@
         flags = store.getmeta(self.filename, node).get(constants.METAKEYFLAG, 0)
         if flags == 0:
             return rawtext
-        text, verifyhash = self._processflagsread(rawtext, flags)
+        text, verifyhash, sidedata = self._processflagsread(rawtext, flags)
         return text
 
     def rawdata(self, node):
--- a/mercurial/revlog.py	Tue Sep 03 22:36:41 2019 +0200
+++ b/mercurial/revlog.py	Tue Sep 03 22:55:04 2019 +0200
@@ -1663,7 +1663,8 @@
             validatehash = self._processflagsraw(rawtext, flags)
             text = rawtext
         else:
-            text, validatehash = self._processflagsread(rawtext, flags)
+            r = self._processflagsread(rawtext, flags)
+            text, validatehash, sidedata = r
         if validatehash:
             self.checkhash(text, node, rev=rev)
         if not validated:
--- a/mercurial/revlogutils/flagutil.py	Tue Sep 03 22:36:41 2019 +0200
+++ b/mercurial/revlogutils/flagutil.py	Tue Sep 03 22:55:04 2019 +0200
@@ -118,7 +118,8 @@
         processed text and ``validatehash`` is a bool indicating whether the
         returned text should be checked for hash integrity.
         """
-        return self._processflagsfunc(text, flags, 'read')
+        text, vhash = self._processflagsfunc(text, flags, 'read')
+        return text, vhash, {}
 
     def _processflagswrite(self, text, flags):
         """Inspect revision data flags and applies write transformations defined
--- a/tests/simplestorerepo.py	Tue Sep 03 22:36:41 2019 +0200
+++ b/tests/simplestorerepo.py	Tue Sep 03 22:55:04 2019 +0200
@@ -294,7 +294,8 @@
             validatehash = self._processflagsraw(rawtext, flags)
             text = rawtext
         else:
-            text, validatehash = self._processflagsread(rawtext, flags)
+            r = self._processflagsread(rawtext, flags)
+            text, validatehash, sidedata = r
         if validatehash:
             self.checkhash(text, node, rev=rev)