# HG changeset patch # User Gregory Szorc # Date 1534530227 0 # Node ID fec01c69b0f037e25917be37f2d5546989f1397d # Parent bbb855c412c6a798978f8ab020a61f9f74d51120 setdiscovery: use revset for resolving DAG heads in a subset This was the final use of dagutil in setdiscovery! For reasons I didn't investigate, feeding a set with nullrev into the heads() revset resulted in a bunch of tests failing. Filtering out nullrev from the input set fixes things. Differential Revision: https://phab.mercurial-scm.org/D4324 diff -r bbb855c412c6 -r fec01c69b0f0 mercurial/setdiscovery.py --- a/mercurial/setdiscovery.py Fri Aug 17 19:12:25 2018 +0000 +++ b/mercurial/setdiscovery.py Fri Aug 17 18:23:47 2018 +0000 @@ -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))