Patchwork [2,of,9] bundlerepo: drop the `baserevision` hack

login
register
mail settings
Submitter Pierre-Yves David
Date Aug. 30, 2019, 4:39 p.m.
Message ID <156d1114c885bb3475e7.1567183171@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/41439/
State Accepted
Headers show

Comments

Pierre-Yves David - Aug. 30, 2019, 4:39 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1567180007 -7200
#      Fri Aug 30 17:46:47 2019 +0200
# Node ID 156d1114c885bb3475e78698657f5794ff14c5eb
# Parent  151b3d3e5176e4f9f4ab1b68756f4ba73dfcf7c4
# EXP-Topic sidedata-prep
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 156d1114c885
bundlerepo: drop the `baserevision` hack

It is not used anywhere anymore, so we can safely drop it.

Patch

diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py
--- a/mercurial/bundlerepo.py
+++ b/mercurial/bundlerepo.py
@@ -142,12 +142,6 @@  class bundlerevlog(revlog.revlog):
     def rawdata(self, nodeorrev, _df=None):
         return self.revision(nodeorrev, _df=_df, raw=True)
 
-    def baserevision(self, nodeorrev):
-        # Revlog subclasses may override 'revision' method to modify format of
-        # content retrieved from revlog. To use bundlerevlog with such class one
-        # needs to override 'baserevision' and make more specific call here.
-        return revlog.revlog.rawdata(self, nodeorrev)
-
     def addrevision(self, *args, **kwargs):
         raise NotImplementedError
 
@@ -167,20 +161,6 @@  class bundlechangelog(bundlerevlog, chan
         bundlerevlog.__init__(self, opener, self.indexfile, cgunpacker,
                               linkmapper)
 
-    def baserevision(self, nodeorrev):
-        # Although changelog doesn't override 'revision' method, some extensions
-        # may replace this class with another that does. Same story with
-        # manifest and filelog classes.
-
-        # This bypasses filtering on changelog.node() and rev() because we need
-        # revision text of the bundle base even if it is hidden.
-        oldfilter = self.filteredrevs
-        try:
-            self.filteredrevs = ()
-            return changelog.changelog.rawdata(self, nodeorrev)
-        finally:
-            self.filteredrevs = oldfilter
-
 class bundlemanifest(bundlerevlog, manifest.manifestrevlog):
     def __init__(self, opener, cgunpacker, linkmapper, dirlogstarts=None,
                  dir=''):
@@ -194,17 +174,6 @@  class bundlemanifest(bundlerevlog, manif
         self._dirlogstarts = dirlogstarts
         self._linkmapper = linkmapper
 
-    def baserevision(self, nodeorrev):
-        node = nodeorrev
-        if isinstance(node, int):
-            node = self.node(node)
-
-        if node in self.fulltextcache:
-            result = '%s' % self.fulltextcache[node]
-        else:
-            result = manifest.manifestrevlog.rawdata(self, nodeorrev)
-        return result
-
     def dirlog(self, d):
         if d in self._dirlogstarts:
             self.bundle.seek(self._dirlogstarts[d])
@@ -219,9 +188,6 @@  class bundlefilelog(filelog.filelog):
         self._revlog = bundlerevlog(opener, self.indexfile,
                                     cgunpacker, linkmapper)
 
-    def baserevision(self, nodeorrev):
-        return filelog.filelog.rawdata(self, nodeorrev)
-
 class bundlepeer(localrepo.localpeer):
     def canpush(self):
         return False