Mercurial > public > mercurial-scm > hg-stable
diff mercurial/debugcommands.py @ 39192:5b32b3c618b2
setdiscovery: don't use dagutil for rev -> node conversions
We don't need to use dagutil to perform a simple rev -> node
conversion.
I haven't measured, but the new code is likely faster, as we
avoid extra function calls and avoid some attribute lookups.
Differential Revision: https://phab.mercurial-scm.org/D4304
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Thu, 16 Aug 2018 19:39:47 +0000 |
parents | 9d6fab487c13 |
children | 858a12846f4f |
line wrap: on
line diff
--- a/mercurial/debugcommands.py Thu Aug 16 19:23:24 2018 +0000 +++ b/mercurial/debugcommands.py Thu Aug 16 19:39:47 2018 +0000 @@ -791,9 +791,11 @@ if not opts.get('nonheads'): ui.write(("unpruned common: %s\n") % " ".join(sorted(short(n) for n in common))) - dag = dagutil.revlogdag(repo.changelog) + cl = repo.changelog + clnode = cl.node + dag = dagutil.revlogdag(cl) all = dag.ancestorset(dag.internalizeall(common)) - common = dag.externalizeall(dag.headsetofconnecteds(all)) + common = {clnode(r) for r in dag.headsetofconnecteds(all)} else: nodes = None if pushedrevs: