changeset 42993:01304095256c

flagprocessors: directly duplicate the deprecated layer back into revlog The code duplication benign and will get removed in a couple of month anyway. Differential Revision: https://phab.mercurial-scm.org/D6821
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sat, 07 Sep 2019 00:22:38 +0200
parents dff95420480f
children 3674797ae8b9
files hgext/remotefilelog/remotefilelog.py mercurial/revlog.py mercurial/revlogutils/flagutil.py
diffstat 3 files changed, 23 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/remotefilelog/remotefilelog.py	Sat Sep 07 00:16:32 2019 +0200
+++ b/hgext/remotefilelog/remotefilelog.py	Sat Sep 07 00:22:38 2019 +0200
@@ -22,6 +22,7 @@
     error,
     mdiff,
     revlog,
+    util,
 )
 from mercurial.utils import storageutil
 from mercurial.revlogutils import flagutil
@@ -307,6 +308,17 @@
                 'remotefilelog does not convert integer rev to node')
         return rev
 
+    def _processflags(self, text, flags, operation, raw=False):
+        """deprecated entry point to access flag processors"""
+        msg = ('_processflag(...) use the specialized variant')
+        util.nouideprecwarn(msg, '5.2', stacklevel=2)
+        if raw:
+            return text, flagutil.processflagsraw(self, text, flags)
+        elif operation == 'read':
+            return flagutil.processflagsread(self, text, flags)
+        else: # write operation
+            return flagutil.processflagswrite(self, text, flags)
+
     def revision(self, node, raw=False):
         """returns the revlog contents at this node.
         this includes the meta data traditionally included in file revlogs.
--- a/mercurial/revlog.py	Sat Sep 07 00:16:32 2019 +0200
+++ b/mercurial/revlog.py	Sat Sep 07 00:22:38 2019 +0200
@@ -1601,6 +1601,17 @@
         return mdiff.textdiff(self.rawdata(rev1),
                               self.rawdata(rev2))
 
+    def _processflags(self, text, flags, operation, raw=False):
+        """deprecated entry point to access flag processors"""
+        msg = ('_processflag(...) use the specialized variant')
+        util.nouideprecwarn(msg, '5.2', stacklevel=2)
+        if raw:
+            return text, flagutil.processflagsraw(self, text, flags)
+        elif operation == 'read':
+            return flagutil.processflagsread(self, text, flags)
+        else: # write operation
+            return flagutil.processflagswrite(self, text, flags)
+
     def revision(self, nodeorrev, _df=None, raw=False):
         """return an uncompressed revision of a given node or revision
         number.
--- a/mercurial/revlogutils/flagutil.py	Sat Sep 07 00:16:32 2019 +0200
+++ b/mercurial/revlogutils/flagutil.py	Sat Sep 07 00:22:38 2019 +0200
@@ -89,17 +89,6 @@
 
     _flagserrorclass = error.RevlogError
 
-    def _processflags(self, text, flags, operation, raw=False):
-        """deprecated entry point to access flag processors"""
-        msg = ('_processflag(...) use the specialized variant')
-        util.nouideprecwarn(msg, '5.2', stacklevel=2)
-        if raw:
-            return text, processflagsraw(self, text, flags)
-        elif operation == 'read':
-            return processflagsread(self, text, flags)
-        else: # write operation
-            return processflagswrite(self, text, flags)
-
 def processflagswrite(revlog, text, flags, sidedata):
     """Inspect revision data flags and applies write transformations defined
     by registered flag processors.