Patchwork D2644: setdiscovery: remove initialsamplesize from a condition

login
register
mail settings
Submitter phabricator
Date March 4, 2018, 4:58 p.m.
Message ID <differential-rev-PHID-DREV-jb7eoxup7n3mhr7tphlp-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/28932/
State Superseded
Headers show

Comments

phabricator - March 4, 2018, 4:58 p.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  It seems more direct to compare the actual sample size. That way we
  can change the sample taken earlier in the code without breaking the
  condition.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/setdiscovery.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/setdiscovery.py b/mercurial/setdiscovery.py
--- a/mercurial/setdiscovery.py
+++ b/mercurial/setdiscovery.py
@@ -175,7 +175,7 @@ 
         ui.debug("all remote heads known locally\n")
         return (srvheadhashes, False, srvheadhashes,)
 
-    if sample and len(ownheads) <= initialsamplesize and all(yesno):
+    if len(sample) == len(ownheads) and all(yesno):
         ui.note(_("all local heads known remotely\n"))
         ownheadhashes = dag.externalizeall(ownheads)
         return (ownheadhashes, True, srvheadhashes,)