Mercurial > hg
comparison rust/hg-cpython/src/discovery.rs @ 42735:5154701a5413
rust-discovery: accept the new 'respectsize' init arg
At this stage, we don't do anything about it: it will be meaningful
in sampling methods that aren't implemented yet.
Differential Revision: https://phab.mercurial-scm.org/D6516
author | Georges Racinet <georges.racinet@octobus.net> |
---|---|
date | Wed, 12 Jun 2019 14:18:12 +0100 |
parents | 326fdce22fb2 |
children | b6f3f704a561 |
comparison
equal
deleted
inserted
replaced
42734:7013c7ce987f | 42735:5154701a5413 |
---|---|
27 use std::cell::RefCell; | 27 use std::cell::RefCell; |
28 | 28 |
29 py_class!(pub class PartialDiscovery |py| { | 29 py_class!(pub class PartialDiscovery |py| { |
30 data inner: RefCell<Box<CorePartialDiscovery<Index>>>; | 30 data inner: RefCell<Box<CorePartialDiscovery<Index>>>; |
31 | 31 |
32 // `_respectsize` is currently only here to replicate the Python API and | |
33 // will be used in future patches inside methods that are yet to be | |
34 // implemented. | |
32 def __new__( | 35 def __new__( |
33 _cls, | 36 _cls, |
34 index: PyObject, | 37 index: PyObject, |
35 targetheads: PyObject | 38 targetheads: PyObject, |
39 _respectsize: bool | |
36 ) -> PyResult<PartialDiscovery> { | 40 ) -> PyResult<PartialDiscovery> { |
37 Self::create_instance( | 41 Self::create_instance( |
38 py, | 42 py, |
39 RefCell::new(Box::new(CorePartialDiscovery::new( | 43 RefCell::new(Box::new(CorePartialDiscovery::new( |
40 Index::new(py, index)?, | 44 Index::new(py, index)?, |