changeset 39234:3682b49e0213

repository: remove candelta() from ifileindex candelta() was previously called by changegroup code. With delta generation moved to the storage API, there are no more external consumers of this method and it can be removed from the storage interface. Differential Revision: https://phab.mercurial-scm.org/D4236
author Gregory Szorc <gregory.szorc@gmail.com>
date Thu, 09 Aug 2018 19:27:54 -0700
parents 8b9b93bf70b1
children 43387fd2aa1f
files mercurial/filelog.py mercurial/repository.py tests/simplestorerepo.py
diffstat 3 files changed, 2 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/filelog.py	Thu Aug 09 19:30:36 2018 -0700
+++ b/mercurial/filelog.py	Thu Aug 09 19:27:54 2018 -0700
@@ -76,9 +76,6 @@
     def deltaparent(self, rev):
         return self._revlog.deltaparent(rev)
 
-    def candelta(self, baserev, rev):
-        return self._revlog.candelta(baserev, rev)
-
     def iscensored(self, rev):
         return self._revlog.iscensored(rev)
 
--- a/mercurial/repository.py	Thu Aug 09 19:30:36 2018 -0700
+++ b/mercurial/repository.py	Thu Aug 09 19:27:54 2018 -0700
@@ -552,9 +552,6 @@
     def deltaparent(rev):
         """"Return the revision that is a suitable parent to delta against."""
 
-    def candelta(baserev, rev):
-        """"Whether a delta can be generated between two revisions."""
-
 class ifiledata(interfaceutil.Interface):
     """Storage interface for data storage of a specific file.
 
--- a/tests/simplestorerepo.py	Thu Aug 09 19:30:36 2018 -0700
+++ b/tests/simplestorerepo.py	Thu Aug 09 19:27:54 2018 -0700
@@ -241,7 +241,7 @@
         p1node = self.parents(self.node(rev))[0]
         return self.rev(p1node)
 
-    def candelta(self, baserev, rev):
+    def _candelta(self, baserev, rev):
         validaterev(baserev)
         validaterev(rev)
 
@@ -527,7 +527,7 @@
                 # for choosing a delta parent.
                 baserev = self.deltaparent(rev)
 
-                if baserev != nullrev and not self.candelta(baserev, rev):
+                if baserev != nullrev and not self._candelta(baserev, rev):
                     baserev = nullrev
 
             revision = None