##// END OF EJS Templates
rust-index: make it possible to clone the struct referencing the C index...
rust-index: make it possible to clone the struct referencing the C index If we are to hand over the C index object to other code, we need to be able to create a new python reference to it. Differential Revision: https://phab.mercurial-scm.org/D7656

File last commit:

r44413:b69d5f3a default
r44462:2728fcb8 default
Show More
test-rust-revlog.py
34 lines | 851 B | text/x-python | PythonLexer
from __future__ import absolute_import
import unittest
try:
from mercurial import rustext
rustext.__name__ # trigger immediate actual import
except ImportError:
rustext = None
else:
from mercurial.rustext import revlog
from mercurial.testing import revlog as revlogtesting
@unittest.skipIf(
rustext is None, "rustext module revlog relies on is not available",
)
class RustRevlogIndexTest(revlogtesting.RevlogBasedTestBase):
def test_heads(self):
idx = self.parseindex()
rustidx = revlog.MixedIndex(idx)
self.assertEqual(rustidx.headrevs(), idx.headrevs())
def test_len(self):
idx = self.parseindex()
rustidx = revlog.MixedIndex(idx)
self.assertEqual(len(rustidx), len(idx))
if __name__ == '__main__':
import silenttestrunner
silenttestrunner.main(__name__)