D4324: setdiscovery: use revset for resolving DAG heads in a subset

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


This revision was automatically updated to reflect the committed changes.
Closed by commit rHGfec01c69b0f0: setdiscovery: use revset for resolving DAG heads in a subset (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4324?vs=10418&id=10445

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

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
@@ -51,7 +51,6 @@
     nullrev,
 )
 from . import (
-    dagutil,
     error,
     util,
 )
@@ -158,8 +157,6 @@
     else:
         ownheads = [rev for rev in cl.headrevs() if rev != nullrev]
 
-    dag = dagutil.revlogdag(cl)
-
     # early exit if we know all the specified remote heads already
     ui.debug("query 1; heads\n")
     roundtrips += 1
@@ -273,10 +270,8 @@
 
     # heads(common) == heads(common.bases) since common represents common.bases
     # and all its ancestors
-    result = dag.headsetofconnecteds(common.bases)
-    # common.bases can include nullrev, but our contract requires us to not
-    # return any heads in that case, so discard that
-    result.discard(nullrev)
+    # The presence of nullrev will confuse heads(). So filter it out.
+    result = set(local.revs('heads(%ld)', common.bases - {nullrev}))
     elapsed = util.timer() - start
     progress.complete()
     ui.debug("%d total queries in %.4fs\n" % (roundtrips, elapsed))



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


More information about the Mercurial-devel mailing list