diff mercurial/exchange.py @ 51658:a0f1378b932e stable

Backed out changeset f28c52a9f7b4 This backout and the previous are due to a large performance regression detected in repositories with a lot of obsmarkers when performing a clone. A better fix will come along at the start of the next cycle.
author Rapha?l Gom?s <rgomes@octobus.net>
date Mon, 08 Jul 2024 16:20:04 +0200
parents f28c52a9f7b4
children 2f8e7e384178
line wrap: on
line diff
--- a/mercurial/exchange.py	Mon Jul 08 16:19:33 2024 +0200
+++ b/mercurial/exchange.py	Mon Jul 08 16:20:04 2024 +0200
@@ -703,8 +703,8 @@
     repo = pushop.repo
     # very naive computation, that can be quite expensive on big repo.
     # However: evolution is currently slow on them anyway.
-    revs = repo.revs(b'::%ln', pushop.futureheads)
-    pushop.outobsmarkers = pushop.repo.obsstore.relevantmarkers(revs=revs)
+    nodes = (c.node() for c in repo.set(b'::%ln', pushop.futureheads))
+    pushop.outobsmarkers = pushop.repo.obsstore.relevantmarkers(nodes)
 
 
 @pushdiscovery(b'bookmarks')
@@ -2605,8 +2605,8 @@
     if kwargs.get('obsmarkers', False):
         if heads is None:
             heads = repo.heads()
-        revs = repo.revs(b'::%ln', heads)
-        markers = repo.obsstore.relevantmarkers(revs=revs)
+        subset = [c.node() for c in repo.set(b'::%ln', heads)]
+        markers = repo.obsstore.relevantmarkers(subset)
         markers = obsutil.sortedmarkers(markers)
         bundle2.buildobsmarkerspart(bundler, markers)