Patchwork D6516: rust-discovery: accept the new 'respectsize' init arg

login
register
mail settings
Submitter phabricator
Date June 12, 2019, 6:13 p.m.
Message ID <differential-rev-PHID-DREV-4desapam23up6zegofjr-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/40454/
State Superseded
Headers show

Comments

phabricator - June 12, 2019, 6:13 p.m.
gracinet created this revision.
Herald added subscribers: mercurial-devel, kevincox, durin42.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  At this stage, we don't do anything about it: it will be meaningful
  in sampling methods that aren't implemented yet.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6516

AFFECTED FILES
  rust/hg-cpython/src/discovery.rs
  tests/test-rust-discovery.py

CHANGE DETAILS




To: gracinet, #hg-reviewers
Cc: durin42, kevincox, mercurial-devel
phabricator - July 22, 2019, 3:25 p.m.
kevincox added a comment.
kevincox accepted this revision.


  It seems weird to add this argument without using it. I would much rather it was added as the implementation was added.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6516/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6516

To: gracinet, #hg-reviewers, kevincox
Cc: durin42, kevincox, mercurial-devel
phabricator - July 23, 2019, 9:03 a.m.
Alphare added a comment.


  In D6516#97578 <https://phab.mercurial-scm.org/D6516#97578>, @kevincox wrote:
  
  > It seems weird to add this argument without using it. I would much rather it was added as the implementation was added.
  
  I think it makes sense considering this is supposed to be a drop-in replacement for the Python implementation, though I would prefer if there were a comment about it.
  I'll update with the comment as well as the new import syntax.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6516/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6516

To: gracinet, #hg-reviewers, kevincox
Cc: Alphare, durin42, kevincox, mercurial-devel

Patch

diff --git a/tests/test-rust-discovery.py b/tests/test-rust-discovery.py
--- a/tests/test-rust-discovery.py
+++ b/tests/test-rust-discovery.py
@@ -68,7 +68,7 @@ 
 
     def testaddcommonsmissings(self):
         idx = self.parseindex()
-        disco = PartialDiscovery(idx, [3])
+        disco = PartialDiscovery(idx, [3], True)
         self.assertFalse(disco.hasinfo())
         self.assertFalse(disco.iscomplete())
 
@@ -84,7 +84,7 @@ 
 
     def testaddmissingsstats(self):
         idx = self.parseindex()
-        disco = PartialDiscovery(idx, [3])
+        disco = PartialDiscovery(idx, [3], True)
         self.assertIsNone(disco.stats()['undecided'], None)
 
         disco.addmissings([2])
@@ -92,7 +92,7 @@ 
 
     def testaddinfocommonfirst(self):
         idx = self.parseindex()
-        disco = PartialDiscovery(idx, [3])
+        disco = PartialDiscovery(idx, [3], True)
         disco.addinfo([(1, True), (2, False)])
         self.assertTrue(disco.hasinfo())
         self.assertTrue(disco.iscomplete())
@@ -100,7 +100,7 @@ 
 
     def testaddinfomissingfirst(self):
         idx = self.parseindex()
-        disco = PartialDiscovery(idx, [3])
+        disco = PartialDiscovery(idx, [3], True)
         disco.addinfo([(2, False), (1, True)])
         self.assertTrue(disco.hasinfo())
         self.assertTrue(disco.iscomplete())
diff --git a/rust/hg-cpython/src/discovery.rs b/rust/hg-cpython/src/discovery.rs
--- a/rust/hg-cpython/src/discovery.rs
+++ b/rust/hg-cpython/src/discovery.rs
@@ -30,7 +30,8 @@ 
     def __new__(
         _cls,
         index: PyObject,
-        targetheads: PyObject
+        targetheads: PyObject,
+        _respectsize: bool
     ) -> PyResult<PartialDiscovery> {
         Self::create_instance(
             py,