This allow to control the effect of the growth rate on the discovery process
while doing analysis.
Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
( )
This allow to control the effect of the growth rate on the discovery process
while doing analysis.
| No Linters Available |
| No Unit Test Coverage |
| Path | Packages | |||
|---|---|---|---|---|
| M | mercurial/configitems.py (6 lines) | |||
| M | mercurial/setdiscovery.py (4 lines) | |||
| M | tests/test-setdiscovery.t (42 lines) |
| Commit | Parents | Author | Summary | Date |
|---|---|---|---|---|
| bc12e61906f4 | f1b1a4f5e1e0 | Pierre-Yves David | Jan 15 2021, 6:48 PM |
| ) | ) | ||||
| # If discovery.grow-sample is False, the sample size used in set discovery will | # If discovery.grow-sample is False, the sample size used in set discovery will | ||||
| # not be increased through the process | # not be increased through the process | ||||
| coreconfigitem( | coreconfigitem( | ||||
| b'devel', | b'devel', | ||||
| b'discovery.grow-sample', | b'discovery.grow-sample', | ||||
| default=True, | default=True, | ||||
| ) | ) | ||||
| # discovery.grow-sample.rate control the rate at which the sample grow | |||||
| coreconfigitem( | |||||
| b'devel', | |||||
| b'discovery.grow-sample.rate', | |||||
| default=1.05, | |||||
| ) | |||||
| # If discovery.randomize is False, random sampling during discovery are | # If discovery.randomize is False, random sampling during discovery are | ||||
| # deterministic. It is meant for integration tests. | # deterministic. It is meant for integration tests. | ||||
| coreconfigitem( | coreconfigitem( | ||||
| b'devel', | b'devel', | ||||
| b'discovery.randomize', | b'discovery.randomize', | ||||
| default=True, | default=True, | ||||
| ) | ) | ||||
| _registerdiffopts(section=b'diff') | _registerdiffopts(section=b'diff') | ||||
| def findcommonheads( | def findcommonheads( | ||||
| ui, | ui, | ||||
| local, | local, | ||||
| remote, | remote, | ||||
| initialsamplesize=100, | initialsamplesize=100, | ||||
| fullsamplesize=200, | fullsamplesize=200, | ||||
| abortwhenunrelated=True, | abortwhenunrelated=True, | ||||
| ancestorsof=None, | ancestorsof=None, | ||||
| samplegrowth=1.05, | |||||
| audit=None, | audit=None, | ||||
| ): | ): | ||||
| """Return a tuple (common, anyincoming, remoteheads) used to identify | """Return a tuple (common, anyincoming, remoteheads) used to identify | ||||
| missing nodes from or in remote. | missing nodes from or in remote. | ||||
| The audit argument is an optional dictionnary that a caller can pass. it | The audit argument is an optional dictionnary that a caller can pass. it | ||||
| will be updated with extra data about the discovery, this is useful for | will be updated with extra data about the discovery, this is useful for | ||||
| debug. | debug. | ||||
| """ | """ | ||||
| samplegrowth = float(ui.config(b'devel', b'discovery.grow-sample.rate')) | |||||
| start = util.timer() | start = util.timer() | ||||
| roundtrips = 0 | roundtrips = 0 | ||||
| cl = local.changelog | cl = local.changelog | ||||
| clnode = cl.node | clnode = cl.node | ||||
| clrev = cl.rev | clrev = cl.rev | ||||
| if ancestorsof is not None: | if ancestorsof is not None: | ||||
| roots: 260 | roots: 260 | ||||
| first undecided set: 1340 | first undecided set: 1340 | ||||
| heads: 260 | heads: 260 | ||||
| roots: 1 | roots: 1 | ||||
| common: 300 | common: 300 | ||||
| missing: 1040 | missing: 1040 | ||||
| common heads: 3ee37d65064a | common heads: 3ee37d65064a | ||||
| $ hg -R a debugdiscovery b --debug --config devel.discovery.randomize=false --config devel.discovery.grow-sample.rate=1.01 | |||||
| comparing with b | |||||
| query 1; heads | |||||
| searching for changes | |||||
| taking quick initial sample | |||||
| query 2; still undecided: 1080, sample size is: 100 | |||||
| sampling from both directions | |||||
| query 3; still undecided: 980, sample size is: 200 | |||||
| sampling from both directions | |||||
| query 4; still undecided: 497, sample size is: 202 | |||||
| sampling from both directions | |||||
| query 5; still undecided: 294, sample size is: 204 | |||||
| sampling from both directions | |||||
| query 6; still undecided: 90, sample size is: 90 | |||||
| 6 total queries in *s (glob) | |||||
| elapsed time: * seconds (glob) | |||||
| round-trips: 6 | |||||
| heads summary: | |||||
| total common heads: 1 | |||||
| also local heads: 0 | |||||
| also remote heads: 0 | |||||
| both: 0 | |||||
| local heads: 260 | |||||
| common: 0 | |||||
| missing: 260 | |||||
| remote heads: 1 | |||||
| common: 0 | |||||
| unknown: 1 | |||||
| local changesets: 1340 | |||||
| common: 300 | |||||
| heads: 1 | |||||
| roots: 1 | |||||
| missing: 1040 | |||||
| heads: 260 | |||||
| roots: 260 | |||||
| first undecided set: 1340 | |||||
| heads: 260 | |||||
| roots: 1 | |||||
| common: 300 | |||||
| missing: 1040 | |||||
| common heads: 3ee37d65064a | |||||
| Test actual protocol when pulling one new head in addition to common heads | Test actual protocol when pulling one new head in addition to common heads | ||||
| $ hg clone -U b c | $ hg clone -U b c | ||||
| $ hg -R c id -ir tip | $ hg -R c id -ir tip | ||||
| 513314ca8b3a | 513314ca8b3a | ||||
| $ hg -R c up -qr default | $ hg -R c up -qr default | ||||
| $ touch c/f | $ touch c/f | ||||
| $ hg -R c ci -Aqm "extra head" | $ hg -R c ci -Aqm "extra head" | ||||