revlog: remove deprecated APIs
authorRaphaël Gomès <rgomes@octobus.net>
Thu, 23 Dec 2021 14:48:31 +0100
changeset 48529 c514936d92b4
parent 48528 75fc2537d93c
child 48530 61fe7e17f21b
revlog: remove deprecated APIs Differential Revision: https://phab.mercurial-scm.org/D11951
mercurial/filelog.py
mercurial/interfaces/repository.py
mercurial/manifest.py
mercurial/pure/parsers.py
mercurial/revlog.py
mercurial/revlogutils/deltas.py
mercurial/revlogutils/revlogv0.py
tests/test-revlog-raw.py
--- a/mercurial/filelog.py	Thu Dec 23 14:47:52 2021 +0100
+++ b/mercurial/filelog.py	Thu Dec 23 14:48:31 2021 +0100
@@ -97,8 +97,8 @@
     def iscensored(self, rev):
         return self._revlog.iscensored(rev)
 
-    def revision(self, node, _df=None, raw=False):
-        return self._revlog.revision(node, _df=_df, raw=raw)
+    def revision(self, node, _df=None):
+        return self._revlog.revision(node, _df=_df)
 
     def rawdata(self, node, _df=None):
         return self._revlog.rawdata(node, _df=_df)
--- a/mercurial/interfaces/repository.py	Thu Dec 23 14:47:52 2021 +0100
+++ b/mercurial/interfaces/repository.py	Thu Dec 23 14:48:31 2021 +0100
@@ -1278,7 +1278,7 @@
     def linkrev(rev):
         """Obtain the changeset revision number a revision is linked to."""
 
-    def revision(node, _df=None, raw=False):
+    def revision(node, _df=None):
         """Obtain fulltext data for a node."""
 
     def rawdata(node, _df=None):
--- a/mercurial/manifest.py	Thu Dec 23 14:47:52 2021 +0100
+++ b/mercurial/manifest.py	Thu Dec 23 14:48:31 2021 +0100
@@ -1819,8 +1819,8 @@
     def checksize(self):
         return self._revlog.checksize()
 
-    def revision(self, node, _df=None, raw=False):
-        return self._revlog.revision(node, _df=_df, raw=raw)
+    def revision(self, node, _df=None):
+        return self._revlog.revision(node, _df=_df)
 
     def rawdata(self, node, _df=None):
         return self._revlog.rawdata(node, _df=_df)
--- a/mercurial/pure/parsers.py	Thu Dec 23 14:47:52 2021 +0100
+++ b/mercurial/pure/parsers.py	Thu Dec 23 14:48:31 2021 +0100
@@ -591,12 +591,6 @@
     def entry_size(self):
         return self.index_format.size
 
-    @property
-    def nodemap(self):
-        msg = b"index.nodemap is deprecated, use index.[has_node|rev|get_rev]"
-        util.nouideprecwarn(msg, b'5.3', stacklevel=2)
-        return self._nodemap
-
     @util.propertycache
     def _nodemap(self):
         nodemap = nodemaputil.NodeMap({sha1nodeconstants.nullid: nullrev})
--- a/mercurial/revlog.py	Thu Dec 23 14:47:52 2021 +0100
+++ b/mercurial/revlog.py	Thu Dec 23 14:48:31 2021 +0100
@@ -741,21 +741,6 @@
         """iterate over all rev in this revlog (from start to stop)"""
         return storageutil.iterrevs(len(self), start=start, stop=stop)
 
-    @property
-    def nodemap(self):
-        msg = (
-            b"revlog.nodemap is deprecated, "
-            b"use revlog.index.[has_node|rev|get_rev]"
-        )
-        util.nouideprecwarn(msg, b'5.3', stacklevel=2)
-        return self.index.nodemap
-
-    @property
-    def _nodecache(self):
-        msg = b"revlog._nodecache is deprecated, use revlog.index.nodemap"
-        util.nouideprecwarn(msg, b'5.3', stacklevel=2)
-        return self.index.nodemap
-
     def hasnode(self, node):
         try:
             self.rev(node)
@@ -870,7 +855,7 @@
         if flags & (flagutil.REVIDX_KNOWN_FLAGS ^ REVIDX_ELLIPSIS) == 0:
             return self.rawsize(rev)
 
-        return len(self.revision(rev, raw=False))
+        return len(self.revision(rev))
 
     def chainbase(self, rev):
         base = self._chainbasecache.get(rev)
@@ -1776,33 +1761,13 @@
 
         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 = b'_processflag(...) use the specialized variant'
-        util.nouideprecwarn(msg, b'5.2', stacklevel=2)
-        if raw:
-            return text, flagutil.processflagsraw(self, text, flags)
-        elif operation == b'read':
-            return flagutil.processflagsread(self, text, flags)
-        else:  # write operation
-            return flagutil.processflagswrite(self, text, flags)
-
-    def revision(self, nodeorrev, _df=None, raw=False):
+    def revision(self, nodeorrev, _df=None):
         """return an uncompressed revision of a given node or revision
         number.
 
         _df - an existing file handle to read from. (internal-only)
-        raw - an optional argument specifying if the revision data is to be
-        treated as raw data when applying flag transforms. 'raw' should be set
-        to True when generating changegroups or in debug commands.
         """
-        if raw:
-            msg = (
-                b'revlog.revision(..., raw=True) is deprecated, '
-                b'use revlog.rawdata(...)'
-            )
-            util.nouideprecwarn(msg, b'5.2', stacklevel=2)
-        return self._revisiondata(nodeorrev, _df, raw=raw)
+        return self._revisiondata(nodeorrev, _df)
 
     def sidedata(self, nodeorrev, _df=None):
         """a map of extra data related to the changeset but not part of the hash
--- a/mercurial/revlogutils/deltas.py	Thu Dec 23 14:47:52 2021 +0100
+++ b/mercurial/revlogutils/deltas.py	Thu Dec 23 14:48:31 2021 +0100
@@ -526,7 +526,7 @@
     else:
         # deltabase is rawtext before changed by flag processors, which is
         # equivalent to non-raw text
-        basetext = revlog.revision(baserev, _df=fh, raw=False)
+        basetext = revlog.revision(baserev, _df=fh)
         fulltext = mdiff.patch(basetext, delta)
 
     try:
--- a/mercurial/revlogutils/revlogv0.py	Thu Dec 23 14:47:52 2021 +0100
+++ b/mercurial/revlogutils/revlogv0.py	Thu Dec 23 14:48:31 2021 +0100
@@ -47,12 +47,6 @@
         node_id=sha1nodeconstants.nullid,
     )
 
-    @property
-    def nodemap(self):
-        msg = b"index.nodemap is deprecated, use index.[has_node|rev|get_rev]"
-        util.nouideprecwarn(msg, b'5.3', stacklevel=2)
-        return self._nodemap
-
     @util.propertycache
     def _nodemap(self):
         nodemap = nodemaputil.NodeMap({sha1nodeconstants.nullid: node.nullrev})
--- a/tests/test-revlog-raw.py	Thu Dec 23 14:47:52 2021 +0100
+++ b/tests/test-revlog-raw.py	Thu Dec 23 14:48:31 2021 +0100
@@ -325,7 +325,7 @@
             rawtext = text
         if rlog.rawsize(rev) != len(rawtext):
             abort('rev %d: wrong rawsize' % rev)
-        if rlog.revision(rev, raw=False) != text:
+        if rlog.revision(rev) != text:
             abort('rev %d: wrong text' % rev)
         if rlog.rawdata(rev) != rawtext:
             abort('rev %d: wrong rawtext' % rev)