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.
--- 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(