changeset 39997:2f80eaf38ed4

filelog: remove revdiff() (API) This proxy method is no longer used. While it might be useful to query a storage backend for the delta between any 2 revisions because the store could have a delta cached and could compute it more efficiently than the caller calling revision() twice in order to compute a delta, since nothing in core is using this API now, I feel comfortable nuking it. Differential Revision: https://phab.mercurial-scm.org/D4792
author Gregory Szorc <gregory.szorc@gmail.com>
date Fri, 28 Sep 2018 09:28:38 -0700
parents dbcb466d0065
children 44c98cbc665f
files mercurial/filelog.py mercurial/repository.py mercurial/testing/storage.py tests/simplestorerepo.py
diffstat 4 files changed, 0 insertions(+), 49 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/filelog.py	Fri Sep 28 09:46:50 2018 -0700
+++ b/mercurial/filelog.py	Fri Sep 28 09:28:38 2018 -0700
@@ -78,9 +78,6 @@
     def revision(self, node, _df=None, raw=False):
         return self._revlog.revision(node, _df=_df, raw=raw)
 
-    def revdiff(self, rev1, rev2):
-        return self._revlog.revdiff(rev1, rev2)
-
     def emitrevisions(self, nodes, nodesorder=None,
                       revisiondata=False, assumehaveparentrevisions=False,
                       deltaprevious=False):
--- a/mercurial/repository.py	Fri Sep 28 09:46:50 2018 -0700
+++ b/mercurial/repository.py	Fri Sep 28 09:28:38 2018 -0700
@@ -586,15 +586,6 @@
         TODO better document the copy metadata and censoring logic.
         """
 
-    def revdiff(rev1, rev2):
-        """Obtain a delta between two revision numbers.
-
-        Operates on raw data in the store (``revision(node, raw=True)``).
-
-        The returned data is the result of ``bdiff.bdiff`` on the raw
-        revision data.
-        """
-
     def emitrevisions(nodes,
                       nodesorder=None,
                       revisiondata=False,
--- a/mercurial/testing/storage.py	Fri Sep 28 09:46:50 2018 -0700
+++ b/mercurial/testing/storage.py	Fri Sep 28 09:28:38 2018 -0700
@@ -396,17 +396,6 @@
         with self.assertRaises(error.LookupError):
             f.cmp(b'\x01' * 20, b'irrelevant')
 
-        self.assertEqual(f.revdiff(nullrev, nullrev), b'')
-
-        with self.assertRaises(IndexError):
-            f.revdiff(0, nullrev)
-
-        with self.assertRaises(IndexError):
-            f.revdiff(nullrev, 0)
-
-        with self.assertRaises(IndexError):
-            f.revdiff(0, 0)
-
         # Emitting empty list is an empty generator.
         gen = f.emitrevisions([])
         with self.assertRaises(StopIteration):
@@ -459,14 +448,6 @@
         self.assertFalse(f.cmp(node, fulltext))
         self.assertTrue(f.cmp(node, fulltext + b'extra'))
 
-        self.assertEqual(f.revdiff(0, 0), b'')
-        self.assertEqual(f.revdiff(nullrev, 0),
-                         b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07%s' %
-                         fulltext)
-
-        self.assertEqual(f.revdiff(0, nullrev),
-                         b'\x00\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00')
-
         # Emitting a single revision works.
         gen = f.emitrevisions([node])
         rev = next(gen)
@@ -577,14 +558,6 @@
         with self.assertRaises(error.LookupError):
             f.cmp(b'\x01' * 20, b'irrelevant')
 
-        self.assertEqual(f.revdiff(0, 1),
-                         b'\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x04\x01' +
-                         fulltext1)
-
-        self.assertEqual(f.revdiff(0, 2),
-                         b'\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x04\x02' +
-                         fulltext2)
-
         # Nodes should be emitted in order.
         gen = f.emitrevisions([node0, node1, node2], revisiondata=True)
 
--- a/tests/simplestorerepo.py	Fri Sep 28 09:46:50 2018 -0700
+++ b/tests/simplestorerepo.py	Fri Sep 28 09:28:38 2018 -0700
@@ -487,16 +487,6 @@
 
         return nodes
 
-    def revdiff(self, rev1, rev2):
-        validaterev(rev1)
-        validaterev(rev2)
-
-        node1 = self.node(rev1)
-        node2 = self.node(rev2)
-
-        return mdiff.textdiff(self.revision(node1, raw=True),
-                              self.revision(node2, raw=True))
-
     def heads(self, start=None, stop=None):
         # This is copied from revlog.py.
         if start is None and stop is None: