Mercurial > hg
diff tests/test-rust-ancestor.py @ 41694:0c7b353ce100
rust-cpython: binding for headrevs()
This uses the core `dagops::retain_heads` to give a Rust implementation
to `mercurial.dagop.headrevs`.
Testing happens for now from `test-rust-ancestors.py`
(for quick and minimal change), but it'd made more sense to put the binary
index data elsewhere and to create a new test python module
author | Georges Racinet <georges.racinet@octobus.net> |
---|---|
date | Thu, 10 Jan 2019 18:25:18 +0100 |
parents | ab0d762d89ef |
children | 2372284d9457 |
line wrap: on
line diff
--- a/tests/test-rust-ancestor.py Wed Jan 16 16:05:27 2019 +0100 +++ b/tests/test-rust-ancestor.py Thu Jan 10 18:25:18 2019 +0100 @@ -19,6 +19,7 @@ LazyAncestors, MissingAncestors, ) + from mercurial.rustext import dagop try: from mercurial.cext import parsers as cparsers @@ -165,6 +166,10 @@ with self.assertRaises(error.WdirUnsupported): list(AncestorsIterator(idx, [node.wdirrev], -1, False)) + def testheadrevs(self): + idx = self.parseindex() + self.assertEqual(dagop.headrevs(idx, [1, 2, 3]), {3}) + if __name__ == '__main__': import silenttestrunner silenttestrunner.main(__name__)