##// END OF EJS Templates
setdiscovery: fix hang when #heads>200 (issue2971)...
Peter Arrenbrecht -
r15063:c20688b7 stable
parent child Browse files
Show More
@@ -41,7 +41,7 b' def _updatesample(dag, nodes, sample, al'
41 def _setupsample(dag, nodes, size):
41 def _setupsample(dag, nodes, size):
42 if len(nodes) <= size:
42 if len(nodes) <= size:
43 return set(nodes), None, 0
43 return set(nodes), None, 0
44 always = set(dag.heads())
44 always = dag.headsetofconnecteds(nodes)
45 desiredlen = size - len(always)
45 desiredlen = size - len(always)
46 if desiredlen <= 0:
46 if desiredlen <= 0:
47 # This could be bad if there are very many heads, all unknown to the
47 # This could be bad if there are very many heads, all unknown to the
@@ -265,4 +265,62 b' Both many new on top of long history:'
265 common heads: 7ead0cba2838
265 common heads: 7ead0cba2838
266
266
267
267
268 One with >200 heads, which used to use up all of the sample:
268
269
270 $ hg init manyheads
271 $ cd manyheads
272 $ echo "+300:r @a" >dagdesc
273 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
274 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
275 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
276 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
277 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
278 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
279 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
280 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
281 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
282 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
283 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
284 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
285 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
286 $ echo "@b *r+3" >>dagdesc # one more head
287 $ hg debugbuilddag <dagdesc
288 reading DAG from stdin
289
290 $ hg heads -t --template . | wc -c
291 261
292
293 $ hg clone -b a . a
294 adding changesets
295 adding manifests
296 adding file changes
297 added 1340 changesets with 0 changes to 0 files (+259 heads)
298 updating to branch a
299 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
300 $ hg clone -b b . b
301 adding changesets
302 adding manifests
303 adding file changes
304 added 304 changesets with 0 changes to 0 files
305 updating to branch b
306 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
307
308 $ hg -R a debugdiscovery b --debug --verbose
309 comparing with b
310 query 1; heads
311 searching for changes
312 taking quick initial sample
313 searching: 2 queries
314 query 2; still undecided: 1080, sample size is: 260
315 sampling from both directions
316 searching: 3 queries
317 query 3; still undecided: 820, sample size is: 260
318 sampling from both directions
319 searching: 4 queries
320 query 4; still undecided: 560, sample size is: 260
321 sampling from both directions
322 searching: 5 queries
323 query 5; still undecided: 300, sample size is: 200
324 5 total queries
325 common heads: 3ee37d65064a
326
General Comments 0
You need to be logged in to leave comments. Login now