diff mercurial/testing/storage.py @ 39998:44c98cbc665f

filelog: remove checkhash() (API) It is unused. While a caller may want to ask the store to validate the hash of some provided text, since there are no in-core consumers of this method, let's drop it for now. Differential Revision: https://phab.mercurial-scm.org/D4793
author Gregory Szorc <gregory.szorc@gmail.com>
date Fri, 28 Sep 2018 09:33:05 -0700
parents 2f80eaf38ed4
children 215fd73cfe52
line wrap: on
line diff
--- a/mercurial/testing/storage.py	Fri Sep 28 09:28:38 2018 -0700
+++ b/mercurial/testing/storage.py	Fri Sep 28 09:33:05 2018 -0700
@@ -368,12 +368,6 @@
             with self.assertRaises(IndexError):
                 f.size(i)
 
-        with self.assertRaises(error.StorageError):
-            f.checkhash(b'', nullid)
-
-        with self.assertRaises(error.LookupError):
-            f.checkhash(b'', b'\x01' * 20)
-
         self.assertEqual(f.revision(nullid), b'')
         self.assertEqual(f.revision(nullid, raw=True), b'')
 
@@ -426,18 +420,6 @@
         with self.assertRaises(IndexError):
             f.size(1)
 
-        f.checkhash(fulltext, node)
-        f.checkhash(fulltext, node, nullid, nullid)
-
-        with self.assertRaises(error.StorageError):
-            f.checkhash(fulltext + b'extra', node)
-
-        with self.assertRaises(error.StorageError):
-            f.checkhash(fulltext, node, b'\x01' * 20, nullid)
-
-        with self.assertRaises(error.StorageError):
-            f.checkhash(fulltext, node, nullid, b'\x01' * 20)
-
         self.assertEqual(f.revision(node), fulltext)
         self.assertEqual(f.revision(node, raw=True), fulltext)
 
@@ -510,20 +492,6 @@
         with self.assertRaises(IndexError):
             f.size(3)
 
-        f.checkhash(fulltext0, node0)
-        f.checkhash(fulltext1, node1)
-        f.checkhash(fulltext1, node1, node0, nullid)
-        f.checkhash(fulltext2, node2, node1, nullid)
-
-        with self.assertRaises(error.StorageError):
-            f.checkhash(fulltext1, b'\x01' * 20)
-
-        with self.assertRaises(error.StorageError):
-            f.checkhash(fulltext1 + b'extra', node1, node0, nullid)
-
-        with self.assertRaises(error.StorageError):
-            f.checkhash(fulltext1, node1, node0, node0)
-
         self.assertEqual(f.revision(node0), fulltext0)
         self.assertEqual(f.revision(node0, raw=True), fulltext0)
         self.assertEqual(f.revision(node1), fulltext1)