changeset 51022:33d2f0164d0d

revlog: drop the df argument to `revision` The intend of this argument is better filled by the `revlog.reading` or `revlog._writing` context. So we drop it to leave rooms for further cleanup and improvements.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 25 Sep 2023 22:52:01 +0200
parents 006aee5ffd35
children 14de15825253
files mercurial/filelog.py mercurial/interfaces/repository.py mercurial/manifest.py mercurial/revlog.py
diffstat 4 files changed, 7 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/filelog.py	Tue Sep 26 01:05:02 2023 +0200
+++ b/mercurial/filelog.py	Mon Sep 25 22:52:01 2023 +0200
@@ -107,8 +107,8 @@
     def iscensored(self, rev):
         return self._revlog.iscensored(rev)
 
-    def revision(self, node, _df=None):
-        return self._revlog.revision(node, _df=_df)
+    def revision(self, node):
+        return self._revlog.revision(node)
 
     def rawdata(self, node, _df=None):
         return self._revlog.rawdata(node, _df=_df)
--- a/mercurial/interfaces/repository.py	Tue Sep 26 01:05:02 2023 +0200
+++ b/mercurial/interfaces/repository.py	Mon Sep 25 22:52:01 2023 +0200
@@ -1282,7 +1282,7 @@
     def linkrev(rev):
         """Obtain the changeset revision number a revision is linked to."""
 
-    def revision(node, _df=None):
+    def revision(node):
         """Obtain fulltext data for a node."""
 
     def rawdata(node, _df=None):
--- a/mercurial/manifest.py	Tue Sep 26 01:05:02 2023 +0200
+++ b/mercurial/manifest.py	Mon Sep 25 22:52:01 2023 +0200
@@ -1821,8 +1821,8 @@
     def checksize(self):
         return self._revlog.checksize()
 
-    def revision(self, node, _df=None):
-        return self._revlog.revision(node, _df=_df)
+    def revision(self, node):
+        return self._revlog.revision(node)
 
     def rawdata(self, node, _df=None):
         return self._revlog.rawdata(node, _df=_df)
--- a/mercurial/revlog.py	Tue Sep 26 01:05:02 2023 +0200
+++ b/mercurial/revlog.py	Mon Sep 25 22:52:01 2023 +0200
@@ -1954,13 +1954,11 @@
 
         return mdiff.textdiff(self.rawdata(rev1), self.rawdata(rev2))
 
-    def revision(self, nodeorrev, _df=None):
+    def revision(self, nodeorrev):
         """return an uncompressed revision of a given node or revision
         number.
-
-        _df - an existing file handle to read from. (internal-only)
         """
-        return self._revisiondata(nodeorrev, _df)
+        return self._revisiondata(nodeorrev)
 
     def sidedata(self, nodeorrev, _df=None):
         """a map of extra data related to the changeset but not part of the hash