mercurial/exchange.py
changeset 22350 6d113cc7a31a
parent 22347 7198cb9b56b9
child 22352 dc371d1f0de1
--- a/mercurial/exchange.py	Wed Aug 20 19:47:35 2014 -0700
+++ b/mercurial/exchange.py	Wed Aug 20 01:15:09 2014 -0700
@@ -297,7 +297,11 @@
     if (obsolete._enabled
         and pushop.repo.obsstore
         and 'obsolete' in pushop.remote.listkeys('namespaces')):
-        pushop.outobsmarkers = pushop.repo.obsstore
+        repo = pushop.repo
+        # very naive computation, that can be quite expensive on big repo.
+        # However: evolution is currently slow on them anyway.
+        nodes = (c.node() for c in repo.set('::%ln', pushop.futureheads))
+        pushop.outobsmarkers = pushop.repo.obsstore.relevantmarkers(nodes)
 
 @pushdiscovery('bookmarks')
 def _pushdiscoverybookmarks(pushop):
@@ -680,7 +684,7 @@
     repo = pushop.repo
     remote = pushop.remote
     pushop.stepsdone.add('obsmarkers')
-    if (pushop.outobsmarkers):
+    if pushop.outobsmarkers:
         rslts = []
         remotedata = obsolete._pushkeyescape(pushop.outobsmarkers)
         for key in sorted(remotedata, reverse=True):