# HG changeset patch # User Gregory Szorc # Date 2018-08-16 19:55:55 # Node ID 26f3d075f36ecd91d218fb3b309ab16ece1c3692 # Parent 9539553f6d172ca2836dfcd62a9ef6e38181f83a debugcommands: use a revset instead of dagutil All this code was doing was finding the nodes that are heads from the ancestors of an input set. This can easily be expressed with a revset without having to go through dagutil. This was the last use of ancestorset() outside of dagutil itself. Differential Revision: https://phab.mercurial-scm.org/D4308 diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py --- a/mercurial/debugcommands.py +++ b/mercurial/debugcommands.py @@ -42,7 +42,6 @@ from . import ( color, context, dagparser, - dagutil, encoding, error, exchange, @@ -791,11 +790,10 @@ def debugdiscovery(ui, repo, remoteurl=" if not opts.get('nonheads'): ui.write(("unpruned common: %s\n") % " ".join(sorted(short(n) for n in common))) - cl = repo.changelog - clnode = cl.node - dag = dagutil.revlogdag(cl) - all = dag.ancestorset(cl.rev(n) for n in common) - common = {clnode(r) for r in dag.headsetofconnecteds(all)} + + clnode = repo.changelog.node + common = repo.revs('heads(::%ln)', common) + common = {clnode(r) for r in common} else: nodes = None if pushedrevs: