Mercurial > public > mercurial-scm > hg
diff mercurial/setdiscovery.py @ 15063:c20688b7c061 stable
setdiscovery: fix hang when #heads>200 (issue2971)
When setting up the next sample, we always add all of the heads, regardless
of the desired max sample size. But if the number of heads exceeds this
size, then we don't add any more nodes from the still undecided set.
(This is debatable per se, and I'll investigate it, but it's how we designed
it at the moment.)
The bug was that we always added the overall heads, not the heads of the
remaining undecided set. Thus, if #heads>200 (desired sample size), we
did not make progress any longer.
author | Peter Arrenbrecht <peter.arrenbrecht@gmail.com> |
---|---|
date | Thu, 25 Aug 2011 21:25:14 +0200 |
parents | 192e02680d09 |
children | 9bea3aed6ee1 |
line wrap: on
line diff
--- a/mercurial/setdiscovery.py Tue Aug 30 14:18:58 2011 +0200 +++ b/mercurial/setdiscovery.py Thu Aug 25 21:25:14 2011 +0200 @@ -41,7 +41,7 @@ def _setupsample(dag, nodes, size): if len(nodes) <= size: return set(nodes), None, 0 - always = set(dag.heads()) + always = dag.headsetofconnecteds(nodes) desiredlen = size - len(always) if desiredlen <= 0: # This could be bad if there are very many heads, all unknown to the