Patchwork [5,of,9] unionrepo: get rid of `baserevision`

login
register
mail settings
Submitter Pierre-Yves David
Date Aug. 30, 2019, 4:39 p.m.
Message ID <f547c2a0dcea052d35b4.1567183174@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/41435/
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 1567181124 -7200
#      Fri Aug 30 18:05:24 2019 +0200
# Node ID f547c2a0dcea052d35b45201d8e4c4e2d14c6787
# Parent  b3b9c5961371426a896a47095a5ff8941174520a
# EXP-Topic sidedata-prep
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r f547c2a0dcea
unionrepo: get rid of `baserevision`

The method is not called anywhere anymore, so we can safely drop it.

Some of the comment get moved to `baserevdiff` because we did not got rid of it
(yet).

Patch

diff --git a/mercurial/unionrepo.py b/mercurial/unionrepo.py
--- a/mercurial/unionrepo.py
+++ b/mercurial/unionrepo.py
@@ -112,14 +112,10 @@  class unionrevlog(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
+    def baserevdiff(self, rev1, rev2):
+        # Revlog subclasses may override 'revdiff' method to modify format of
         # content retrieved from revlog. To use unionrevlog with such class one
-        # needs to override 'baserevision' and make more specific call here.
-        return revlog.revlog.revision(self, nodeorrev)
-
-    def baserevdiff(self, rev1, rev2):
-        # Exists for the same purpose as baserevision.
+        # needs to override 'baserevdiff' and make more specific call here.
         return revlog.revlog.revdiff(self, rev1, rev2)
 
     def addrevision(self, text, transaction, link, p1=None, p2=None, d=None):
@@ -140,13 +136,10 @@  class unionchangelog(unionrevlog, change
         unionrevlog.__init__(self, opener, self.indexfile, changelog2,
                              linkmapper)
 
-    def baserevision(self, nodeorrev):
-        # Although changelog doesn't override 'revision' method, some extensions
+    def baserevdiff(self, rev1, rev2):
+        # Although changelog doesn't override 'revdiff' method, some extensions
         # may replace this class with another that does. Same story with
         # manifest and filelog classes.
-        return changelog.changelog.revision(self, nodeorrev)
-
-    def baserevdiff(self, rev1, rev2):
         return changelog.changelog.revdiff(self, rev1, rev2)
 
 class unionmanifest(unionrevlog, manifest.manifestrevlog):
@@ -156,9 +149,6 @@  class unionmanifest(unionrevlog, manifes
         unionrevlog.__init__(self, opener, self.indexfile, manifest2,
                              linkmapper)
 
-    def baserevision(self, nodeorrev):
-        return manifest.manifestrevlog.revision(self, nodeorrev)
-
     def baserevdiff(self, rev1, rev2):
         return manifest.manifestrevlog.revdiff(self, rev1, rev2)
 
@@ -172,9 +162,6 @@  class unionfilelog(filelog.filelog):
         self.repotiprev = self._revlog.repotiprev
         self.revlog2 = self._revlog.revlog2
 
-    def baserevision(self, nodeorrev):
-        return filelog.filelog.revision(self, nodeorrev)
-
     def baserevdiff(self, rev1, rev2):
         return filelog.filelog.revdiff(self, rev1, rev2)