Patchwork D6811: flagprocessors: return sidedata map in `_processflagsread`

login
register
mail settings
Submitter phabricator
Date Sept. 7, 2019, 9:29 a.m.
Message ID <differential-rev-PHID-DREV-nwos7xlaceiwjx3evoxn-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/41517/
State New
Headers show

Comments

phabricator - Sept. 7, 2019, 9:29 a.m.
marmoute created this revision.
marmoute added reviewers: yuja, durin42.
Herald added a reviewer: indygreg.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Right now, flag processors does not return sidedata, by they will. So, we
  prepare the caller to receive it.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6811

AFFECTED FILES
  hgext/remotefilelog/remotefilelog.py
  mercurial/revlog.py
  mercurial/revlogutils/flagutil.py
  tests/simplestorerepo.py

CHANGE DETAILS




To: marmoute, yuja, durin42, indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/tests/simplestorerepo.py b/tests/simplestorerepo.py
--- a/tests/simplestorerepo.py
+++ b/tests/simplestorerepo.py
@@ -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)
 
diff --git a/mercurial/revlogutils/flagutil.py b/mercurial/revlogutils/flagutil.py
--- a/mercurial/revlogutils/flagutil.py
+++ b/mercurial/revlogutils/flagutil.py
@@ -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
diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -1660,7 +1660,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:
diff --git a/hgext/remotefilelog/remotefilelog.py b/hgext/remotefilelog/remotefilelog.py
--- a/hgext/remotefilelog/remotefilelog.py
+++ b/hgext/remotefilelog/remotefilelog.py
@@ -325,7 +325,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):