# HG changeset patch # User Gregory Szorc # Date 1537821350 25200 # Node ID a269fa55467e4952a8cb9d1f8743dd12e1a57943 # Parent d909c44d29e16b14051efe4852bf4461f1b95aa6 filelog: stop proxying deltaparent() (API) 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(). Differential Revision: https://phab.mercurial-scm.org/D4751 diff -r d909c44d29e1 -r a269fa55467e mercurial/filelog.py --- a/mercurial/filelog.py Mon Sep 24 12:49:17 2018 -0700 +++ b/mercurial/filelog.py Mon Sep 24 13:35:50 2018 -0700 @@ -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) diff -r d909c44d29e1 -r a269fa55467e mercurial/repository.py --- a/mercurial/repository.py Mon Sep 24 12:49:17 2018 -0700 +++ b/mercurial/repository.py Mon Sep 24 13:35:50 2018 -0700 @@ -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 -r d909c44d29e1 -r a269fa55467e mercurial/testing/storage.py --- a/mercurial/testing/storage.py Mon Sep 24 12:49:17 2018 -0700 +++ b/mercurial/testing/storage.py Mon Sep 24 13:35:50 2018 -0700 @@ -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 -r d909c44d29e1 -r a269fa55467e tests/simplestorerepo.py --- a/tests/simplestorerepo.py Mon Sep 24 12:49:17 2018 -0700 +++ b/tests/simplestorerepo.py Mon Sep 24 13:35:50 2018 -0700 @@ -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)