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))