comparison tests/test-rust-revlog.py @ 44012:443dc1655923

rust-index: expose a method to retrieve the C index The code for `shortesthexnodeidprefix` need to access the actual C index. For now we grant its wish and expose a method to do so. Once we have the nodemap in Rust, we will be able to implement the same feature from rust and we will be able to drop this method. Differential Revision: https://phab.mercurial-scm.org/D7658
author Georges Racinet <georges.racinet@octobus.net>
date Thu, 12 Dec 2019 03:39:14 +0100
parents c627f1b2f3c3
children 89a2afe31e82
comparison
equal deleted inserted replaced
44011:c627f1b2f3c3 44012:443dc1655923
23 def test_heads(self): 23 def test_heads(self):
24 idx = self.parseindex() 24 idx = self.parseindex()
25 rustidx = revlog.MixedIndex(idx) 25 rustidx = revlog.MixedIndex(idx)
26 self.assertEqual(rustidx.headrevs(), idx.headrevs()) 26 self.assertEqual(rustidx.headrevs(), idx.headrevs())
27 27
28 def test_get_cindex(self):
29 # drop me once we no longer need the method for shortest node
30 idx = self.parseindex()
31 rustidx = revlog.MixedIndex(idx)
32 cidx = rustidx.get_cindex()
33 self.assertTrue(idx is cidx)
34
28 def test_len(self): 35 def test_len(self):
29 idx = self.parseindex() 36 idx = self.parseindex()
30 rustidx = revlog.MixedIndex(idx) 37 rustidx = revlog.MixedIndex(idx)
31 self.assertEqual(len(rustidx), len(idx)) 38 self.assertEqual(len(rustidx), len(idx))
32 39