comparison mercurial/commands.py @ 49229:ed9170ff791a

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.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 17 May 2022 13:53:14 +0100
parents 5ad37b5bfb31
children 2e726c934fcd
comparison
equal deleted inserted replaced
49228:b909dd35d9ab 49229:ed9170ff791a
1598 if base: 1598 if base:
1599 if dests: 1599 if dests:
1600 raise error.InputError( 1600 raise error.InputError(
1601 _(b"--base is incompatible with specifying destinations") 1601 _(b"--base is incompatible with specifying destinations")
1602 ) 1602 )
1603 common = [repo[rev].node() for rev in base] 1603 cl = repo.changelog
1604 heads = [repo[r].node() for r in revs] if revs else None 1604 common = [cl.node(rev) for rev in base]
1605 heads = [cl.node(r) for r in revs] if revs else None
1605 outgoing = discovery.outgoing(repo, common, heads) 1606 outgoing = discovery.outgoing(repo, common, heads)
1606 missing = outgoing.missing 1607 missing = outgoing.missing
1607 excluded = outgoing.excluded 1608 excluded = outgoing.excluded
1608 else: 1609 else:
1609 missing = set() 1610 missing = set()