discovery: avoid computing identical sets of heads twice
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 28 Feb 2019 00:12:12 +0100
changeset 41880 55919b96c02a
parent 41879 e5ece0f46b40
child 41881 e514799e4e07
discovery: avoid computing identical sets of heads twice The very same set of heads is computed in the previous statement, it seems more efficient to just copy that result.
mercurial/setdiscovery.py
--- a/mercurial/setdiscovery.py	Wed Feb 27 23:55:19 2019 +0100
+++ b/mercurial/setdiscovery.py	Thu Feb 28 00:12:12 2019 +0100
@@ -193,7 +193,7 @@
         sample = set(repo.revs('heads(%ld)', revs))
 
         # update from heads
-        revsheads = set(repo.revs('heads(%ld)', revs))
+        revsheads = sample.copy()
         _updatesample(revs, revsheads, sample, repo.changelog.parentrevs)
 
         # update from roots