D4310: setdiscovery: don't use dagutil to compute heads

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Sat Aug 18 04:06:49 EDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG860e83cd97de: setdiscovery: don't use dagutil to compute heads (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4310?vs=10404&id=10434

REVISION DETAIL
  https://phab.mercurial-scm.org/D4310

AFFECTED FILES
  mercurial/setdiscovery.py

CHANGE DETAILS

diff --git a/mercurial/setdiscovery.py b/mercurial/setdiscovery.py
--- a/mercurial/setdiscovery.py
+++ b/mercurial/setdiscovery.py
@@ -144,16 +144,17 @@
     cl = local.changelog
     clnode = cl.node
     clrev = cl.rev
-    localsubset = None
 
     if ancestorsof is not None:
-        localsubset = [clrev(n) for n in ancestorsof]
-    dag = dagutil.revlogdag(cl, localsubset=localsubset)
+        ownheads = [clrev(n) for n in ancestorsof]
+    else:
+        ownheads = [rev for rev in cl.headrevs() if rev != nullrev]
+
+    dag = dagutil.revlogdag(cl, localsubset=ownheads)
 
     # early exit if we know all the specified remote heads already
     ui.debug("query 1; heads\n")
     roundtrips += 1
-    ownheads = dag.heads()
     sample = _limitsample(ownheads, initialsamplesize)
     # indices between sample and externalized version must match
     sample = list(sample)



To: indygreg, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list