Commit ed9170ff authored by Pierre-Yves David's avatar Pierre-Yves David 🐙
Browse files

bundle: quick fix to ludicrous performance penalty

We tried a `hg bundle --base ':(tip^)' --rev 'all()'` on a large repository and
it spent 3 minutes on this 2 list comprehensions. This change remove this cost.

There are still a lot of low hanging fruits as the command still take 30
seconds. However this is a trivial patch with a massive speedup so I'll just
sent it.
parent b909dd35d9ab
Pipeline #54371 passed with stages
in 33 minutes
......@@ -1600,8 +1600,9 @@
raise error.InputError(
_(b"--base is incompatible with specifying destinations")
)
common = [repo[rev].node() for rev in base]
heads = [repo[r].node() for r in revs] if revs else None
cl = repo.changelog
common = [cl.node(rev) for rev in base]
heads = [cl.node(r) for r in revs] if revs else None
outgoing = discovery.outgoing(repo, common, heads)
missing = outgoing.missing
excluded = outgoing.excluded
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment