Mercurial > hg
comparison mercurial/setdiscovery.py @ 46359:0600e8467101
discovery: add config options to control sample size
This get useful for running analysis of the current algorithm.
Differential Revision: https://phab.mercurial-scm.org/D9813
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sun, 17 Jan 2021 23:21:33 +0100 |
parents | 6ee9bd69ff7f |
children | f165105400d0 |
comparison
equal
deleted
inserted
replaced
46358:009130064813 | 46359:0600e8467101 |
---|---|
284 | 284 |
285 def findcommonheads( | 285 def findcommonheads( |
286 ui, | 286 ui, |
287 local, | 287 local, |
288 remote, | 288 remote, |
289 initialsamplesize=100, | |
290 fullsamplesize=200, | |
291 abortwhenunrelated=True, | 289 abortwhenunrelated=True, |
292 ancestorsof=None, | 290 ancestorsof=None, |
293 audit=None, | 291 audit=None, |
294 ): | 292 ): |
295 """Return a tuple (common, anyincoming, remoteheads) used to identify | 293 """Return a tuple (common, anyincoming, remoteheads) used to identify |
313 ownheads = [clrev(n) for n in ancestorsof] | 311 ownheads = [clrev(n) for n in ancestorsof] |
314 else: | 312 else: |
315 ownheads = [rev for rev in cl.headrevs() if rev != nullrev] | 313 ownheads = [rev for rev in cl.headrevs() if rev != nullrev] |
316 | 314 |
317 initial_head_exchange = ui.configbool(b'devel', b'discovery.exchange-heads') | 315 initial_head_exchange = ui.configbool(b'devel', b'discovery.exchange-heads') |
318 | 316 initialsamplesize = ui.configint(b'devel', b'discovery.sample-size.initial') |
317 fullsamplesize = ui.configint(b'devel', b'discovery.sample-size') | |
319 # We also ask remote about all the local heads. That set can be arbitrarily | 318 # We also ask remote about all the local heads. That set can be arbitrarily |
320 # large, so we used to limit it size to `initialsamplesize`. We no longer | 319 # large, so we used to limit it size to `initialsamplesize`. We no longer |
321 # do as it proved counter productive. The skipped heads could lead to a | 320 # do as it proved counter productive. The skipped heads could lead to a |
322 # large "undecided" set, slower to be clarified than if we asked the | 321 # large "undecided" set, slower to be clarified than if we asked the |
323 # question for all heads right away. | 322 # question for all heads right away. |