# HG changeset patch # User Pierre-Yves David # Date 1652791994 -3600 # Node ID ed9170ff791a760e7e6ec51fee4372263112e7b7 # Parent b909dd35d9abb16f292aae0f0dda21153c699c82 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. diff -r b909dd35d9ab -r ed9170ff791a mercurial/commands.py --- a/mercurial/commands.py Fri May 20 14:27:46 2022 +0200 +++ b/mercurial/commands.py Tue May 17 13:53:14 2022 +0100 @@ -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