mercurial/setdiscovery.py
changeset 39165 860e83cd97de
parent 39161 858a12846f4f
child 39166 484c9fe570a7
equal deleted inserted replaced
39164:01ab7f656a10 39165:860e83cd97de
   142 
   142 
   143     roundtrips = 0
   143     roundtrips = 0
   144     cl = local.changelog
   144     cl = local.changelog
   145     clnode = cl.node
   145     clnode = cl.node
   146     clrev = cl.rev
   146     clrev = cl.rev
   147     localsubset = None
       
   148 
   147 
   149     if ancestorsof is not None:
   148     if ancestorsof is not None:
   150         localsubset = [clrev(n) for n in ancestorsof]
   149         ownheads = [clrev(n) for n in ancestorsof]
   151     dag = dagutil.revlogdag(cl, localsubset=localsubset)
   150     else:
       
   151         ownheads = [rev for rev in cl.headrevs() if rev != nullrev]
       
   152 
       
   153     dag = dagutil.revlogdag(cl, localsubset=ownheads)
   152 
   154 
   153     # early exit if we know all the specified remote heads already
   155     # early exit if we know all the specified remote heads already
   154     ui.debug("query 1; heads\n")
   156     ui.debug("query 1; heads\n")
   155     roundtrips += 1
   157     roundtrips += 1
   156     ownheads = dag.heads()
       
   157     sample = _limitsample(ownheads, initialsamplesize)
   158     sample = _limitsample(ownheads, initialsamplesize)
   158     # indices between sample and externalized version must match
   159     # indices between sample and externalized version must match
   159     sample = list(sample)
   160     sample = list(sample)
   160 
   161 
   161     with remote.commandexecutor() as e:
   162     with remote.commandexecutor() as e: