# HG changeset patch # User Pierre-Yves David # Date 1712312687 -7200 # Node ID d8287e43540fe449cb0cf8c01d3ec2bab47878d5 # Parent e0194b3ea312cb0429fe0444672d92c8cb35b593 phases: stop using `repo.set` in `remotephasessummary` The `repository.set` create changectx on the fly, an expensive operation. Using `repo.revs` and a direct rev-num → node-id translation will be significantly faster. This is especially true as we prepare ourself to no longer do the rev-num → node-id transalation there. The speedup is a bit lost in the overall noisyness of the slow phase discovery algorithm, but it save a small amount of time in my benchmark. diff -r e0194b3ea312 -r d8287e43540f mercurial/phases.py --- a/mercurial/phases.py Fri Apr 05 12:02:43 2024 +0200 +++ b/mercurial/phases.py Fri Apr 05 12:24:47 2024 +0200 @@ -1154,8 +1154,8 @@ self.publicheads = [to_node(r) for r in heads] self.draftroots = [to_node(r) for r in roots] # Get the list of all "heads" revs draft on remote - dheads = unfi.set(b'heads(%ld::%ld)', roots, remote_subset) - self.draftheads = [c.node() for c in dheads] + dheads = unfi.revs(b'heads(%ld::%ld)', roots, remote_subset) + self.draftheads = [to_node(r) for r in dheads] def new_heads(