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.
hg-reviewers |
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.
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/debugcommands.py (10 lines) |
Status | Author | Revision | |
---|---|---|---|
Closed | indygreg | D4330 dagutil: remove module | |
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg |
) | ) | ||||
from . import ( | from . import ( | ||||
bundle2, | bundle2, | ||||
changegroup, | changegroup, | ||||
cmdutil, | cmdutil, | ||||
color, | color, | ||||
context, | context, | ||||
dagparser, | dagparser, | ||||
dagutil, | |||||
encoding, | encoding, | ||||
error, | error, | ||||
exchange, | exchange, | ||||
extensions, | extensions, | ||||
filemerge, | filemerge, | ||||
filesetlang, | filesetlang, | ||||
formatter, | formatter, | ||||
hg, | hg, | ||||
# enable in-client legacy support | # enable in-client legacy support | ||||
remote = localrepo.locallegacypeer(remote.local()) | remote = localrepo.locallegacypeer(remote.local()) | ||||
common, _in, hds = treediscovery.findcommonincoming(repo, remote, | common, _in, hds = treediscovery.findcommonincoming(repo, remote, | ||||
force=True) | force=True) | ||||
common = set(common) | common = set(common) | ||||
if not opts.get('nonheads'): | if not opts.get('nonheads'): | ||||
ui.write(("unpruned common: %s\n") % | ui.write(("unpruned common: %s\n") % | ||||
" ".join(sorted(short(n) for n in common))) | " ".join(sorted(short(n) for n in common))) | ||||
cl = repo.changelog | |||||
clnode = cl.node | clnode = repo.changelog.node | ||||
dag = dagutil.revlogdag(cl) | common = repo.revs('heads(::%ln)', common) | ||||
all = dag.ancestorset(cl.rev(n) for n in common) | common = {clnode(r) for r in common} | ||||
common = {clnode(r) for r in dag.headsetofconnecteds(all)} | |||||
else: | else: | ||||
nodes = None | nodes = None | ||||
if pushedrevs: | if pushedrevs: | ||||
revs = scmutil.revrange(repo, pushedrevs) | revs = scmutil.revrange(repo, pushedrevs) | ||||
nodes = [repo[r].node() for r in revs] | nodes = [repo[r].node() for r in revs] | ||||
common, any, hds = setdiscovery.findcommonheads(ui, repo, remote, | common, any, hds = setdiscovery.findcommonheads(ui, repo, remote, | ||||
ancestorsof=nodes) | ancestorsof=nodes) | ||||
common = set(common) | common = set(common) |