D4751: filelog: stop proxying deltaparent() (API)

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Wed Sep 26 18:29:54 UTC 2018


indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  deltaparent() obtains the revision number of the base revision a
  delta in storage is stored against. It is highly revlog-centric and
  may not apply to other storage backends. As a result, it doesn't
  belong on the generic file storage interface.
  
  This method/proxy is no longer used in core. The last consumer was
  probably changegroup code and went away with the transition to
  emitrevisions().

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D4751

AFFECTED FILES
  mercurial/filelog.py
  mercurial/repository.py
  mercurial/testing/storage.py
  tests/simplestorerepo.py

CHANGE DETAILS

diff --git a/tests/simplestorerepo.py b/tests/simplestorerepo.py
--- a/tests/simplestorerepo.py
+++ b/tests/simplestorerepo.py
@@ -233,12 +233,6 @@
 
         return self._indexbyrev[rev][b'flags']
 
-    def deltaparent(self, rev):
-        validaterev(rev)
-
-        p1node = self.parents(self.node(rev))[0]
-        return self.rev(p1node)
-
     def _candelta(self, baserev, rev):
         validaterev(baserev)
         validaterev(rev)
diff --git a/mercurial/testing/storage.py b/mercurial/testing/storage.py
--- a/mercurial/testing/storage.py
+++ b/mercurial/testing/storage.py
@@ -122,15 +122,6 @@
         with self.assertRaises(error.LookupError):
             f.children(b'\x01' * 20)
 
-        self.assertEqual(f.deltaparent(nullrev), nullrev)
-
-        for i in range(-5, 5):
-            if i == nullrev:
-                continue
-
-            with self.assertRaises(IndexError):
-                f.deltaparent(i)
-
     def testsinglerevision(self):
         f = self._makefilefn()
         with self._maketransactionfn() as tr:
@@ -200,8 +191,6 @@
 
         self.assertEqual(f.children(node), [])
 
-        self.assertEqual(f.deltaparent(0), nullrev)
-
     def testmultiplerevisions(self):
         fulltext0 = b'x' * 1024
         fulltext1 = fulltext0 + b'y'
@@ -313,10 +302,6 @@
         self.assertEqual(f.children(node1), [node2])
         self.assertEqual(f.children(node2), [])
 
-        self.assertEqual(f.deltaparent(0), nullrev)
-        self.assertEqual(f.deltaparent(1), 0)
-        self.assertEqual(f.deltaparent(2), 1)
-
     def testmultipleheads(self):
         f = self._makefilefn()
 
diff --git a/mercurial/repository.py b/mercurial/repository.py
--- a/mercurial/repository.py
+++ b/mercurial/repository.py
@@ -533,9 +533,6 @@
         Returns a list of nodes.
         """
 
-    def deltaparent(rev):
-        """"Return the revision that is a suitable parent to delta against."""
-
 class ifiledata(interfaceutil.Interface):
     """Storage interface for data storage of a specific file.
 
diff --git a/mercurial/filelog.py b/mercurial/filelog.py
--- a/mercurial/filelog.py
+++ b/mercurial/filelog.py
@@ -67,9 +67,6 @@
     def children(self, node):
         return self._revlog.children(node)
 
-    def deltaparent(self, rev):
-        return self._revlog.deltaparent(rev)
-
     def iscensored(self, rev):
         return self._revlog.iscensored(rev)
 



To: indygreg, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list