mercurial/setdiscovery.py
changeset 23817 813aaaf2aff3
parent 23816 34d4b58580d1
child 25113 0ca8410ea345
equal deleted inserted replaced
23816:34d4b58580d1 23817:813aaaf2aff3
    83         for p in dag.parents(curr):
    83         for p in dag.parents(curr):
    84             if not nodes or p in nodes:
    84             if not nodes or p in nodes:
    85                 dist.setdefault(p, d + 1)
    85                 dist.setdefault(p, d + 1)
    86                 visit.append(p)
    86                 visit.append(p)
    87 
    87 
    88 def _setupsample(dag, nodes, size):
       
    89     always = dag.headsetofconnecteds(nodes)
       
    90     desiredlen = size - len(always)
       
    91     if desiredlen <= 0:
       
    92         # This could be bad if there are very many heads, all unknown to the
       
    93         # server. We're counting on long request support here.
       
    94         return always, None, desiredlen
       
    95     return always, set(), desiredlen
       
    96 
       
    97 def _takequicksample(dag, nodes, size):
    88 def _takequicksample(dag, nodes, size):
    98     """takes a quick sample of size <size>
    89     """takes a quick sample of size <size>
    99 
    90 
   100     It is meant for initial sampling and focuses on querying heads and close
    91     It is meant for initial sampling and focuses on querying heads and close
   101     ancestors of heads.
    92     ancestors of heads.